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: deepcopy can't copy self-referential new-style classes
Type: Stage:
Components: Interpreter Core Versions: Python 2.3
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: gvanrossum, scp93ch, staschuk
Priority: normal Keywords:

Created on 2003-03-13 10:14 by scp93ch, last changed 2022-04-10 16:07 by admin. This issue is now closed.

Messages (3)
msg15117 - (view) Author: Stephen C Phillips (scp93ch) Date: 2003-03-13 10:14
Given this code:

import copy
class Foo(object):
    pass
f = Foo()
f.bar = f
g = copy.deepcopy(f)

You will find with Python 2.3a2 and 2.2.2:

f is f.bar   ->  True
g is g.bar   ->  False
g is not f   -> True
g.bar is not f   -> True

Obviously, all the statements should be True.

msg15118 - (view) Author: Steven Taschuk (staschuk) Date: 2003-03-30 11:10
Logged In: YES 
user_id=666873

See patch 707900.

http://www.python.org/sf/707900
msg15119 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2003-06-13 19:27
Logged In: YES 
user_id=6380

Fixed using that patch.
History
Date User Action Args
2022-04-10 16:07:38adminsetgithub: 38157
2003-03-13 10:14:29scp93chcreate