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.2.tar.gz
(6.6 kB
view hashes)
Built Distribution
Close
Hashes for nr.stream-0.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f17b3def42cdb07c2c22aa06fa03cbc05ad539227e72432d813a0681bb717361 |
|
MD5 | 2a7047e72e120b421c7a2740a1f716e6 |
|
BLAKE2b-256 | 4850ca22fe34e3fe11af36f20fbaaf6eb770cd9cb26104b4a848d0dd87e88633 |