You can upgrade to python3. There, the range is not limited to βshortβ integers.
Another workaround would be to use xrange for small integers and add them to some constant inside the loop, for example.
offset, upperlimit = 2**65, 2**65+100
for i in xrange(upperlimit-offset):
j = i + offset
# ... do something with j
source
share