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.

classification
Title: copy() method of dictionaries is not "deep"
Type: Stage:
Components: Interpreter Core Versions: Python 2.4
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: akuchling Nosy List: akuchling, blueyed, georg.brandl
Priority: normal Keywords:

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:20adminsetgithub: 43988
2008-01-11 17:36:56akuchlingsetstatus: open -> closed
resolution: wont fix
messages: + msg59727
2006-09-17 20:35:47blueyedcreate