Is there any way to use xrange with a start or stop value that exceeds sys.maxint?

import sys
print sys.maxint
2147483647
start = sys.maxint-1
for i in xrange(start, start+1):
...   pass
...
start = sys.maxint
for i in xrange(start, start+1):
...   pass
...
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OverflowError: Python int too large to convert to C long


Works okay with range, though:

start = sys.maxint
for i in range(start, start+1):
...   pass
...

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to