[ python-Bugs-1560327 ] copy() method of dictionaries is not "deep"

SourceForge.net noreply at sourceforge.net
Mon Sep 18 20:53:49 CEST 2006


Bugs item #1560327, was opened at 2006-09-17 20:35
Message generated for change (Comment added) made by gbrandl
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1560327&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Interpreter Core
Group: Python 2.4
>Status: Open
>Resolution: None
Priority: 5
Submitted By: daniel hahler (blueyed)
>Assigned to: A.M. Kuchling (akuchling)
Summary: copy() method of dictionaries is not "deep"

Initial Comment:
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/

----------------------------------------------------------------------

>Comment By: Georg Brandl (gbrandl)
Date: 2006-09-18 18:53

Message:
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.

----------------------------------------------------------------------

Comment By: daniel hahler (blueyed)
Date: 2006-09-18 18:39

Message:
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.

----------------------------------------------------------------------

Comment By: Georg Brandl (gbrandl)
Date: 2006-09-18 17:49

Message:
Logged In: YES 
user_id=849994

Sure, if you like...

----------------------------------------------------------------------

Comment By: daniel hahler (blueyed)
Date: 2006-09-18 17:26

Message:
Logged In: YES 
user_id=663176

So it's not a bug?

Then please change the "Resolution" accordingly.

----------------------------------------------------------------------

Comment By: Georg Brandl (gbrandl)
Date: 2006-09-18 07:23

Message:
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.)

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1560327&group_id=5470


More information about the Python-bugs-list mailing list