Skip to main content

Rusty iterators in Python.

Project description

iterum

Iterum logo

PyPI - Version PyPI - Python Version project - uv

linting - Ruff types - Pyright License - MIT


Rusty iterators in Python.

Installation

pip install iterum

Documentation

The documentation is made with Zensical and is hosted by GitHub Pages.

Example

from iterum import iterum, Some, nil, seq

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

lst = (
    seq(5)
    .map(lambda x: x**2 + 1)
    .filter(lambda x: x % 2)
    .collect()
)
assert lst == [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.3.0-py3-none-any.whl (25.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: iterum-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 25.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.5

File hashes

Hashes for iterum-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b37cb368cea8648b017510fbe8bd44a7f855ccb871e3ca29049672801f3cb287
MD5 265e6e91fdbfb2c5e791b987f9b52f98
BLAKE2b-256 8096bc657333ce1f6938eb21e87389597e8af8e4bfe9548ac63102c7e460efe0

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