summaryrefslogtreecommitdiffstatshomepage
path: root/tests/stress/dict_create_max.py
blob: 3c75db20da0c068b2347fb3d2c8dbf7f18f705f5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
# The aim with this test is to hit the maximum resize/rehash size of a dict,
# where there are no more primes in the table of growing allocation sizes.
# This value is 54907 items.

d = {}
try:
    for i in range(54908):
        d[i] = i
except MemoryError:
    pass

# Just check the dict still has the first value
print(d[0])