Can anyone explain why this happened with list and how to clean list after appending to another list?
>>> t = {} >>> t["m"] = [] >>> t {'m': []} >>> t["m"].append('qweasdasd aweter') >>> t["m"].append('asdasdaf ghghdhj') >>> t {'m': ['qweasdasd aweter', 'asdasdaf ghghdhj']} >>> r = [] >>> r.append(t) >>> r [{'m': ['qweasdasd aweter', 'asdasdaf ghghdhj']}] >>> t["m"] = [] >>> r [{'m': []}]
appendto r, In almost every case Python doesn't do anything unless you've explicitly told it to.