Skip to main content

Rusty iterators in Python.

Project description

iterum

Iterum logo

PyPI - Version PyPI - Python Version Hatch project

linting - Ruff code style - Black types - Pyright License - MIT


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


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

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

iterum-0.2.0-py3-none-any.whl (26.9 kB view details)

Uploaded Python 3

File details

Details for the file iterum-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: iterum-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 26.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for iterum-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b65827ad18e121300211c212126a0796bfd282200939e2558e4bed57bc9d5f57
MD5 0d135f2777154177d31aca109d8805cb
BLAKE2b-256 31e60eb7190f6a72d6a1b1d1b719f8e9943a8edf3dc6fd6a209d16a9ebd3f72e

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