Stream¶
- class streams.abc.Stream[source]¶
Bases:
collections.abc.Container[streams.abc.VT]An abstract base class for stream classes (i.e. an interface for robust objects that are capable of holding an indefinite amount of data). All stream classes should directly or indirectly derive from this class.
- abstract classmethod map(fn, *streams, does_memoize=True)[source]¶
Returns a new stream that contains the return values of the function applied to each item in the streams.
- Parameters
fn (collections.abc.Callable[..., streams.abc.MT]) – the function to be applied to each value in the stream
streams (streams.abc.Stream) – the tuple of streams that contain the values to be mapped
does_memoize (bool) – By default, the node will cache the result of
next_thunk. This can potentially hog a lot of memory. To turn caching off, setdoes_memoizetoFalse. It might be desirable to propagate this to composite streams generated by custom functions.
- Return type
streams.abc.Stream[streams.abc.MT]
- abstract property value: streams.abc.VT¶
Returns the value of the node.