Skip to content

Latest commit

 

History

History
42 lines (29 loc) · 895 Bytes

index.rst

File metadata and controls

42 lines (29 loc) · 895 Bytes

Welcome to streams's documentation!

Contents:

streams.Stream

Examples

A basic (and rather uninteresting) stream:

>>> for x in Stream(range(3)):
...     print(x)
0
1
2

Streams offer various operations as methods. For example getting first 10 even integers:

>>> from itertools import count
>>> Stream(count()).filter(lambda x: x % 2 == 0)[:10].to_list()
[0, 2, 4, 6, 8, 10, 12, 14, 16, 18]

Slicing endless iterators is supported by default.

Indices and tables

  • genindex
  • modindex
  • search