Rusty iterators in Python.
Project description
iterum
Rusty iterators in Python.
Installation
pip install iterum
Documentation
The documentation is made with Material for MkDocs and is hosted by GitHub Pages.
Example
from iterum import iterum, Some, nil
itr = iterum([1, 2])
assert itr.next() == Some(1)
assert itr.next() == Some(2)
assert itr.next() == nil
itr = iterum([1, 2, 3, 4])
assert itr.fold(0, lambda acc, x: acc + x) == 10
x = range(5)
y = (
iterum(x)
.map(lambda x: x**2 + 1)
.filter(lambda x: x % 2)
.collect()
)
assert y == [1, 5, 17]
License
iterum
is distributed under the terms of the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
iterum-0.2.0-py3-none-any.whl
(26.9 kB
view hashes)