Skip to content

Instantly share code, notes, and snippets.

@mahmoud
Created February 8, 2015 07:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mahmoud/c749f540580d7e0cdc00 to your computer and use it in GitHub Desktop.
Save mahmoud/c749f540580d7e0cdc00 to your computer and use it in GitHub Desktop.
PDW: xrange has its limits, thanks to being implemented in C. somewhat defeats the purpose of xrange.
$ python
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.maxint
9223372036854775807
>>> xrange(0, 2 ** 64 - 1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OverflowError: Python int too large to convert to C long
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment