Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Lazy range function for Python 2.x or xrange's drop-in replacement for long integers

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 .gitignore
Octocat-spinner-32 MANIFEST.in
Octocat-spinner-32 MIT-LICENSE.txt
Octocat-spinner-32 Makefile
Octocat-spinner-32 README.rst
Octocat-spinner-32 ez_setup.py
Octocat-spinner-32 lrange.py
Octocat-spinner-32 setup.py
Octocat-spinner-32 test_lrange.py
Octocat-spinner-32 tox.ini
README.rst

lrange - unlimited xrange in pure Python

lrange is a lazy range function for Python 2.x or xrange drop-in replacement for long integers.

lrange is a pure Python analog of the builtin range function from Python 3.x.

>>> from lrange import lrange
>>> r = lrange(2**100, 2**101, 2**100)
>>> len(r)
1
>>> for i in r:
...     print i,
1267650600228229401496703205376
>>> for i in r:
...     print i,
1267650600228229401496703205376
>>> 2**100 in r
True
>>> r[0], r[-1]
(1267650600228229401496703205376L, 1267650600228229401496703205376L)
>>> L = list(r)
>>> L2 = [1, 2, 3]
>>> L2[:] = r
>>> L == L2 == [2**100]
True

Files are licensed under the MIT License. See the file MIT-LICENSE.txt for details.

The latest version is at http://github.com/zed/lrange/

Something went wrong with that request. Please try again.