(x)range( 40000000000, 40000000001 )

Chris Connett kill_cxc_spam_0117 at cs.rit.edu
Sun Jun 29 14:48:37 EDT 2003


It seems range and xrange don't like longs that can't be sqeezed into ints:

With Python 2.3b1+:

 >>> xrange( 40000000000, 40000000001 )
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
OverflowError: long int too large to convert to int
 >>> range( 40000000000, 40000000001 )
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
OverflowError: long int too large to convert to int
 >>>

Its not a critical problem, and I can find a way around it.  It's a just 
little disconcerting that (x)range doesn't work with big longs, and it 
seems it would not be too difficult to make work.





More information about the Python-list mailing list