Commit 1dca482d authored by Guido van Rossum's avatar Guido van Rossum

Somehow, copy() of a classic class object was handled

atomically, but deepcopy() didn't support this at all.
I don't see any reason for this, so I'm adding ClassType
to the set of types that are deep-copied atomically.
parent c06e3acc
......@@ -220,6 +220,7 @@ except AttributeError:
pass
d[types.TypeType] = _deepcopy_atomic
d[types.XRangeType] = _deepcopy_atomic
d[types.ClassType] = _deepcopy_atomic
def _deepcopy_list(x, memo):
y = []
......
......@@ -239,7 +239,7 @@ class TestCopy(unittest.TestCase):
pass
tests = [None, 42, 2L**100, 3.14, True, False, 1j,
"hello", u"hello\u1234", f.func_code,
NewStyle, xrange(10)]
NewStyle, xrange(10), Classic]
for x in tests:
self.assert_(copy.deepcopy(x) is x, `x`)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment