Is there a good reason why we cannot (as of 2.1.1) deepcopy complex objects?

Tim Peters tim.one at comcast.net
Tue Mar 12 23:56:56 EST 2002


[Carl Banks]
> Subject: Is there a good reason why we cannot (as of 2.1.1) deepcopy
> complex objects?

I doubt it.  Works fine in 2.2:

Python 2.2 (#28, Dec 21 2001, 12:21:22) [MSC 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import copy
>>> z = 1-1j
>>> copy.copy(z)
(1-1j)
>>> copy.deepcopy(z)
(1-1j)
>>>

The copy module got quite an overhaul for 2.2, and that likely fixed many
odd old bugs.

> Strangely, I've found no mention of this anywhere: the docs, the
> Python FAQ, or the Google archives.

The right place to look would have been the Python bug database on
SourceForge, but I didn't find a specific bug report there either.  That is
mildly strange.  It's not strange that the 2 people using complex numbers in
Python didn't add a FAQ entry, though <wink>.





More information about the Python-list mailing list