Il 27 Feb 2007 16:14:20 -0800, [EMAIL PROTECTED] ha scritto: > Those mean different things: > >>>> a=[1] >>>> b=a >>>> a += [2] >>>> a > [1, 2] >>>> b > [1, 2] >>>> a=[1] >>>> b=a >>>> a = a + [2] >>>> a > [1, 2] >>>> b > [1]
This is a really nasty one! I just answered to Tim above here, and then I saw your example... I had never realized that kind of list behaviour. That's probably because i never use + and += on lists (i prefer the more explicit append() or extend() and i do copy list explictly when I want to) , BTW I think this behaviour is tricky! -- Alan Franzoni <[EMAIL PROTECTED]> - Togli .xyz dalla mia email per contattarmi. Remove .xyz from my address in order to contact me. - GPG Key Fingerprint (Key ID = FE068F3E): 5C77 9DC3 BD5B 3A28 E7BC 921A 0255 42AA FE06 8F3E -- http://mail.python.org/mailman/listinfo/python-list