]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
copy and deepcopy builtin functions atomically. Fixes #746304.
authorMartin v. Löwis <martin@v.loewis.de>
Sat, 14 Jun 2003 07:20:04 +0000 (07:20 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Sat, 14 Jun 2003 07:20:04 +0000 (07:20 +0000)
Also backport 2.36 (deepcopy classes atomically).

Lib/copy.py
Misc/NEWS

index eae3b6f6a6734a1de31b20b4cf74693edf155ab4..9782c6b565938d7a7cc90e80d988f1f33b4669aa 100644 (file)
@@ -112,6 +112,7 @@ except AttributeError:
 d[types.TypeType] = _copy_atomic
 d[types.XRangeType] = _copy_atomic
 d[types.ClassType] = _copy_atomic
+d[types.BuiltinFunctionType] = _copy_atomic
 
 def _copy_list(x):
     return x[:]
@@ -211,6 +212,8 @@ except AttributeError:
     pass
 d[types.TypeType] = _deepcopy_atomic
 d[types.XRangeType] = _deepcopy_atomic
+d[types.ClassType] = _deepcopy_atomic
+d[types.BuiltinFunctionType] = _deepcopy_atomic
 
 def _deepcopy_list(x, memo):
     y = []
index ec4a61115027ac39f9b33604758bbfa01392c3f2..eb746f32f7fed269c04bb9043d715aac5a7e051d 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -1,3 +1,8 @@
+What's New in Python 2.2.4?
+
+- SF #746304: Builtin functions are now copy.[deep]copyable.
+  Classes are now also deepcopyable.
+
 What's New in Python 2.2.3 (final) ?
 Release date: 30-May-2003
 ====================================