2.3 list reverse() bug?

Mark Carter cartermark46 at ukmail.com
Thu Dec 25 06:03:53 EST 2003


I did this:

Python 2.3 (#46, Jul 29 2003, 18:54:32) [MSC v.1200 32 bit (Intel)] on
win32

>>> d1 = [1,2]
>>> d2 = d1
>>> d2.reverse()
>>> print d1 #note: d1, not d2
[2, 1]
>>> 

Surely that can't be right: d1 should still be [1,2]. If it is
"right", then I expect that many people are in for a suprise.




More information about the Python-list mailing list