Skip to main content

Treat an iterator as a list

Project description

iterlist

Lazily evaluated lists in Python

An iterlist.IterList accepts a single iterable as its only constructor argument.

The iterlist.IterList behaves as a normal list, and will only evaluate the iterable as needed to satisfy requests for element.

If there is a request for index [5], then elements 0 - 5 will be evaluated if they have not been yet. Certain operations like len and negative indexing will force the list to be evaluated. This decision was made to make the iterlist outwardly appear as much like a normal list as possible.

Infinite Iterators

This implementation does not make any attempt to protect you from running out of memory attempting to construct a list from an infinite iterator. A future version may implement InfiniteIterList, which will not have support for any operation which would require consuming the entire iterable.

License

BSD 2-clause (inherited from lazylist)

Prior Work

Apparently this is not a new idea...

Forked from: https://github.com/ryanhaining/lazylist (2014/10)

http://stupidpythonideas.blogspot.com/2014/07/lazy-python-lists.html (2014/07)

http://code.activestate.com/recipes/576410-lazy-lists/ (2008/08)

http://www.logarithmic.net/pfh/blog/01193268742 (unknown)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iterlist-0.4.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

iterlist-0.4-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file iterlist-0.4.tar.gz.

File metadata

  • Download URL: iterlist-0.4.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.1

File hashes

Hashes for iterlist-0.4.tar.gz
Algorithm Hash digest
SHA256 bae41e52d3c90f001ba009c349f1bc550f5409901fe628e87ac68c716cd877bc
MD5 03984f5bab337933444abeaf44a9862b
BLAKE2b-256 91e2b52f9a1f5b59b136f21e0ad99ba502f7f97fb90de43ea56ec9c112d4a561

See more details on using hashes here.

File details

Details for the file iterlist-0.4-py3-none-any.whl.

File metadata

  • Download URL: iterlist-0.4-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.1

File hashes

Hashes for iterlist-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ac8db5cec4245e6ab1a1b65a5a103e1561352213b4e648bef6d7556d59987bc8
MD5 6e235a229a846e102531a44a0587df45
BLAKE2b-256 2df4617947388eae627f55566b6f0f156252f51155e8a60c8f0868867947aef9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page