Python has a maximum size for lists, and according to the documentation, calling
import sys
print(sys.maxsize)
will return the maximum size. On my machine, calling this code returns 9223372036854775807 = 2^63 - 1.
On the other hand, calling something like
a = [1]*(2**32)
returns a memory error. 2^32 is much smaller than 2^63-1 - is there any way to initialize a list of 2^32 items while avoiding a memory error?