learn/doc/python_pointer_memory at main · gyuho/learn · GitHub
Skip to content

Latest commit

 

History

History

Folders and files

README.md

back to contents

Python: pointer, memory

↑ top




reference

#!/usr/bin/python -u

def change(tdict, tlist):
    tdict["A"] = True
    tlist.append(tdict)

if __name__ == "__main__":
    td = {}
    td["A"] = 100
    tl = [1,2,3]
    change(td, tl)
    print td # {'A': True}
    print tl # [1, 2, 3, {'A': True}]

For more, please read this article.

↑ top