[Python-bugs-list] [ python-Bugs-702858 ] deepcopy can't copy self-referential new-style classes
SourceForge.net
noreply@sourceforge.net
Fri, 13 Jun 2003 12:27:38 -0700
Bugs item #702858, was opened at 2003-03-13 05:14
Message generated for change (Comment added) made by gvanrossum
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: Closed
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.
----------------------------------------------------------------------
>Comment By: Guido van Rossum (gvanrossum)
Date: 2003-06-13 15:27
Message:
Logged In: YES
user_id=6380
Fixed using that patch.
----------------------------------------------------------------------
Comment By: Steven Taschuk (staschuk)
Date: 2003-03-30 06:10
Message:
Logged In: YES
user_id=666873
See patch 707900.
http://www.python.org/sf/707900
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=702858&group_id=5470