[Python-bugs-list] [ python-Bugs-702858 ] deepcopy can't copy self-referential new-style classes

SourceForge.net noreply@sourceforge.net
Thu, 13 Mar 2003 02:14:29 -0800


Bugs item #702858, was opened at 2003-03-13 10:14
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=702858&group_id=5470

Category: Type/class unification
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Stephen C Phillips (scp93ch)
Assigned to: Nobody/Anonymous (nobody)
Summary: deepcopy can't copy self-referential new-style classes

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



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

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