bpo-33712: OrderedDict only creates od_fast_nodes cache if needed (GH-7349)

This commit is contained in:
Serhiy Storchaka 2018-10-20 02:27:45 +03:00 committed by Victor Stinner
parent d6a61f2326
commit 6f17e51345
2 changed files with 20 additions and 52 deletions

View file

@ -697,9 +697,9 @@ class CPythonOrderedDictTests(OrderedDictTests, unittest.TestCase):
nodesize = calcsize('Pn2P')
od = OrderedDict()
check(od, basicsize + 8*p + 8 + 5*entrysize) # 8byte indices + 8*2//3 * entry table
check(od, basicsize + 8 + 5*entrysize) # 8byte indices + 8*2//3 * entry table
od.x = 1
check(od, basicsize + 8*p + 8 + 5*entrysize)
check(od, basicsize + 8 + 5*entrysize)
od.update([(i, i) for i in range(3)])
check(od, basicsize + 8*p + 8 + 5*entrysize + 3*nodesize)
od.update([(i, i) for i in range(3, 10)])