Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f156a44

Browse files
committed
Added Unicode objects to the copy mechanism. Since these are immutable,
they are copied as atomic types.
1 parent 6272731 commit f156a44

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Lib/copy.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ def _copy_atomic(x):
8484
d[types.LongType] = _copy_atomic
8585
d[types.FloatType] = _copy_atomic
8686
d[types.StringType] = _copy_atomic
87+
d[types.UnicodeType] = _copy_atomic
8788
try:
8889
d[types.CodeType] = _copy_atomic
8990
except AttributeError:
@@ -160,6 +161,7 @@ def _deepcopy_atomic(x, memo):
160161
d[types.LongType] = _deepcopy_atomic
161162
d[types.FloatType] = _deepcopy_atomic
162163
d[types.StringType] = _deepcopy_atomic
164+
d[types.UnicodeType] = _deepcopy_atomic
163165
d[types.CodeType] = _deepcopy_atomic
164166
d[types.TypeType] = _deepcopy_atomic
165167
d[types.XRangeType] = _deepcopy_atomic

0 commit comments

Comments
 (0)