Skip to main content
PyPI Build Status

This small package provides a proxy list to a list-returning function:

>>> from lazylist import LazyList
>>> l = LazyList(lambda: x)
>>> x = [1, 2, 3]
>>> list(l)
[1, 2, 3]

More precisely, view function doesn’t have to return an exact list, but an any squence object e.g. str, tuple:

>>> x = "hello"
>>> list(l)
['h', 'e', 'l', 'l', 'o']

It satisfies collections.abc.Sequence protocol:

>>> from collections import Sequence
>>> isinstance(l, Sequence)
True
>>> l[-1]
'o'
>>> len(l)
5

However, it doesn’t satisfy collections.abc.MutableSequence protocol. In other words, it’s immutable:

>>> from collections import MutableSequence
>>> isinstance(l, MutableSequence)
False
>>> l[0] = 'H'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'LazyList' object does not support item assignment

Distributed under LGPLv3 or higher.

Todos

  • LazySet

  • LazyMap

Release files for lazylist 0.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lazylist 0.9.0
File Size Uploaded
lazylist-0.9.0.tar.gz 2.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lazylist 0.9.0
File Interpreter ABI Platform
lazylist-0.9.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 6.2 kB

Release files / lazylist-0.9.0.tar.gz

Download URL lazylist-0.9.0.tar.gz
Size 2.3 kB
Tags Source
SHA-256 checksum
How to use checksums
7bb960f2d39d0e6b274d65738bad3147721906298b1dbe7561158261666c2caa
BLAKE2b-256 checksum
How to use checksums
3c6584cb36de68ab72059fca33016125cb6a2c1963817e42d0b04643bab21814
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / lazylist-0.9.0-py2.py3-none-any.whl

Download URL lazylist-0.9.0-py2.py3-none-any.whl
Size 3.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
a04be55176997956387e0705823d822e0031a5d787fb1e792787ed1fd07f5ba6
BLAKE2b-256 checksum
How to use checksums
75ebdc3c807c2d0638898b3f57d2f57d3c044876ba6548cb66be488d1b0bbee3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.9.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page