(no title)
triMichael | 7 years ago
If you create a list "list1", set "list2 = list1", and change list1, both of the lists change. When I learned Python, this was a major source of confusion for me. Eventually I learned that in Python, instead of nothing being a pointer as it first appears, it is actually that everything is a pointer. On the other hand, while the same things occur in C++, the assignment operator does a shallow copy and anytime you are doing a pointer copy it is explicit.
notdonspaulding|7 years ago
Ned Batchelder is a good resource for learning many things about python, and this talk he gave at Pycon some years ago is no exception:
https://nedbatchelder.com/text/names1.html
EricE|7 years ago
What a small world...