Use iterators like Java streams.
Project description
Note: This package is in the dangerous land of
0.x.y
versions and may be subject to breaking changes with minor version increments.
nr.stream
Provides a Stream
class which allows chained operations on a stream of values.
Example
from nr.stream import Stream
values = [3, 6, 4, 7, 1, 2, 5]
assert list(Stream(values).chunks(values, 3, fill=0).map(sum)) == [13, 10, 5]
Copyright © 2020 Niklas Rosenstein
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 Distribution
nr.stream-0.2.0.tar.gz
(6.5 kB
view hashes)
Built Distribution
Close
Hashes for nr.stream-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8fd0a11281f9d9bb53adfc610a3310b76efbb10e870b69bbd20e47ab5dc9df33 |
|
MD5 | 1de4ba8b6a8c83af2351a77b361eb444 |
|
BLAKE2b-256 | 1949d41eee1851b74b75188c6e57150100c3aa58cd4642b32fb51fa89e1f3ae8 |