summaryrefslogtreecommitdiff
path: root/Lib/copy.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-09-28 18:16:13 +0000
committerGuido van Rossum <guido@python.org>2001-09-28 18:16:13 +0000
commit068bd9bc60111d870bc1fd50676bd30d3048824b (patch)
treeb71d54d55264e6840ebab9b74e2655bf8cae9c44 /Lib/copy.py
parentabb3f25b74b36278ea4f33f528643e2e1a64a199 (diff)
downloadcpython-068bd9bc60111d870bc1fd50676bd30d3048824b.tar.gz
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 e907738180..14eff05734 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