dict_create_max.py 328 B

12345678910111213
  1. # The aim with this test is to hit the maximum resize/rehash size of a dict,
  2. # where there are no more primes in the table of growing allocation sizes.
  3. # This value is 54907 items.
  4. d = {}
  5. try:
  6. for i in range(54908):
  7. d[i] = i
  8. except MemoryError:
  9. pass
  10. # Just check the dict still has the first value
  11. print(d[0])