We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2ade6e9 commit 579da43Copy full SHA for 579da43
1 file changed
Lib/test/test_copy.py
@@ -429,19 +429,22 @@ def test_deepcopy_reflexive_dict(self):
429
430
def test_deepcopy_keepalive(self):
431
memo = {}
432
+ memo[id(memo)] = []
433
x = []
434
y = copy.deepcopy(x, memo)
435
self.assertIs(memo[id(memo)][0], x)
436
437
def test_deepcopy_dont_memo_immutable(self):
438
439
440
x = [1, 2, 3, 4]
441
442
self.assertEqual(y, x)
443
# There's the entry for the new list, and the keep alive.
444
self.assertEqual(len(memo), 2)
445
446
447
448
x = [(1, 2)]
449
450
0 commit comments