This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author nharkins
Recipients nharkins
Date 2010-08-15.20:12:24
SpamBayes Score 0.00408359
Marked as misclassified No
Message-id <1281903146.28.0.294470710617.issue9616@psf.upfronthosting.co.za>
In-reply-to
Content
hi. after using deepcopy() on a nested dict/list structure, 
i noticed that modifications to the deepcopied structure were 
affecting the original. this looks to me like a serious bug:

>>> import copy
>>> foo = { 'a':[1,2,3], 'b':{'c':[4,5]} }
>>> bar = copy.deepcopy(foo)
>>> id(foo)
4297360512
>>> id(bar)
4297373104
>>> id(foo['a'])
4299410752
>>> id(bar['a'])
4299760200
>>> id(foo['b'])
4297371984
>>> id(bar['b'])
4297373920
>>> id(foo['b']['c'])
4299721040
>>> id(bar['b']['c'])
4299761496
>>> id(foo['b']['c'][0])
4297074656
>>> id(bar['b']['c'][0])
4297074656
History
Date User Action Args
2010-08-15 20:12:26nharkinssetrecipients: + nharkins
2010-08-15 20:12:26nharkinssetmessageid: <1281903146.28.0.294470710617.issue9616@psf.upfronthosting.co.za>
2010-08-15 20:12:24nharkinslinkissue9616 messages
2010-08-15 20:12:24nharkinscreate