cyclic data structures
John Salerno
johnjsal at NOSPAMgmail.com
Mon Feb 13 16:32:32 EST 2006
Carsten Haese wrote:
> L is [1,2] before the append. After the append, L is [1,2,L], which is
> [1,2,[1,2,L]], which is [1,2,[1,2,[1,2,L]]] etc into infinity. L
> literally contains itself after the append.
Ah, this perfectly explains it now! I guess I was dancing around this
fact, but now that you've typed it out, I see that L actually changed in
place!
Thanks guys!
More information about the Python-list
mailing list