[Tutor] When is = a copy and when is it an alias

Danny Yoo dyoo at hashcollision.org
Wed Jan 29 01:45:35 CET 2014


Hi Denis,

Ok, stop for a moment.

Visit:    http://pythontutor.com/visualize.html

Specifically, here's your program:


http://pythontutor.com/visualize.html#code=a%3D%5B1,%5B1,2%5D%5D%0Ab%3Da%0Aa%3D%5B1,%5B2,3%5D%5D%0Aa%5B0%5D%3D0%0Aa%5B1%5D%3D%5B0,0%5D&mode=display&cumulative=false&heapPrimitives=false&drawParentPointers=false&textReferences=false&showOnlyOutputs=false&py=2&curInstr=3


Step through it, and see if anything there makes sense.  :P

Try a few more simple programs there, including the examples discussed
earlier on this thread.

I have a feeling that your mental model of what's happening is not
quite matching the machine, so the visualizer at
http://pythontutor.com/visualize.html may help bridge that gap.



Good luck!


More information about the Tutor mailing list