Issue 1560327: copy() method of dictionaries is not "deep" (original) (raw)

Created on 2006-09-17 20:35 by blueyed, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
dictcopy_not_like_copydeepcopy.py blueyed,2006-09-17 20:35 Simple demo script
Messages (7)
msg29866 - (view) Author: daniel hahler (blueyed) * Date: 2006-09-17 20:35
Unlike copy.deepcopy() the copy() method of a dictionary does not copy objects in the dict, but seem to use them by reference. I'm not sure, if this is really a bug - but I would have expected it to behave like copy.deepcopy(), according to http://www.python.org/infogami-faq/programming/how-do-i-copy-an-object-in-python/
msg29867 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-09-18 07:23
Logged In: YES user_id=849994 The infogami FAQ is "interactive", so if you find the text misleading, please add a comment yourself via the "add comment" link. (You may have to login to infogami to do that.)
msg29868 - (view) Author: daniel hahler (blueyed) * Date: 2006-09-18 17:26
Logged In: YES user_id=663176 So it's not a bug? Then please change the "Resolution" accordingly.
msg29869 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-09-18 17:49
Logged In: YES user_id=849994 Sure, if you like...
msg29870 - (view) Author: daniel hahler (blueyed) * Date: 2006-09-18 18:39
Logged In: YES user_id=663176 I cannot comment on infogami. It says the following is spam: """ Please note that olddict.copy() does not "deepcopy" the dictionary. So if you have a dictionary of objects, those will still be copied by reference. """ I've tried rephrasing it slightly, to no avail. Can you update the wiki page directly? Thanks.
msg29871 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-09-18 18:53
Logged In: YES user_id=849994 Sorry, I can't since I don't have any privileges there too. Assigning to AMK, perhaps he can do something about it.
msg59727 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2008-01-11 17:36
The Infogami FAQ is no longer available from python.org, so I'll just close this item.
History
Date User Action Args
2022-04-11 14:56:20 admin set github: 43988
2008-01-11 17:36:56 akuchling set status: open -> closedresolution: wont fixmessages: +
2006-09-17 20:35:47 blueyed create