mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
Merge 9aaf916dbf into 7099af8f5e
This commit is contained in:
commit
de9833efff
3 changed files with 40 additions and 0 deletions
|
|
@ -767,6 +767,18 @@ class C(list):
|
|||
self.assertIsNot(x[0], y[0])
|
||||
self.assertIsNot(x.foo, y.foo)
|
||||
|
||||
class L(list):
|
||||
def __getstate__(self):
|
||||
return list(self)
|
||||
|
||||
def __setstate__(self, state):
|
||||
self[:] = state
|
||||
|
||||
l1 = L([1, 2])
|
||||
l2 = copy.deepcopy(l1)
|
||||
self.assertEqual(l1, l2)
|
||||
self.assertEqual(len(l1), len(l2))
|
||||
|
||||
def test_copy_tuple_subclass(self):
|
||||
class C(tuple):
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue