[Tutor] Long list error

William Stephens wstephens10 at suddenlink.net
Mon Mar 9 01:27:42 CET 2009


I was working on a sieve of eratosthenes and ran into an error I don't 

 >>> size = 10000000000
 >>> l = [0,1]*(size/2)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OverflowError: cannot fit 'long' into an index-sized integer

Is there a type or something that I can do to prevent this error? Or am 
I on the wrong track for such large primes?

William Stephens

More information about the Tutor mailing list