summaryrefslogtreecommitdiffstats
path: root/Lib/copy.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-09-28 18:16:13 (GMT)
committerGuido van Rossum <guido@python.org>2001-09-28 18:16:13 (GMT)
commit8b9def3aacd4b23797d58341e39a431ef128fc69 (patch)
tree9e12f4db5adb6f4a453328a5854266293a1bf284 /Lib/copy.py
parent6cef6d5d62f083ada715da3610ce12147b625ee2 (diff)
downloadcpython-8b9def3aacd4b23797d58341e39a431ef128fc69.zip
cpython-8b9def3aacd4b23797d58341e39a431ef128fc69.tar.gz
cpython-8b9def3aacd4b23797d58341e39a431ef128fc69.tar.bz2
Add complex to the dispatch tables, to avoid going through the whole
rigmarole of __reduce__.
Diffstat (limited to 'Lib/copy.py')
-rw-r--r--Lib/copy.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/copy.py b/Lib/copy.py
index e907738..14eff05 100644
--- a/Lib/copy.py
+++ b/Lib/copy.py
@@ -96,6 +96,10 @@ d[types.NoneType] = _copy_atomic
d[types.IntType] = _copy_atomic
d[types.LongType] = _copy_atomic
d[types.FloatType] = _copy_atomic
+try:
+ d[types.ComplexType] = _copy_atomic
+except AttributeError:
+ pass
d[types.StringType] = _copy_atomic
try:
d[types.UnicodeType] = _copy_atomic
@@ -184,6 +188,10 @@ d[types.NoneType] = _deepcopy_atomic
d[types.IntType] = _deepcopy_atomic
d[types.LongType] = _deepcopy_atomic
d[types.FloatType] = _deepcopy_atomic
+try:
+ d[types.ComplexType] = _deepcopy_atomic
+except AttributeError:
+ pass
d[types.StringType] = _deepcopy_atomic
try:
d[types.UnicodeType] = _deepcopy_atomic