core.utils#
Module Contents#
Functions#
Allows to compose a value and up to multiple functions that use this value. |
Data#
API#
- core.utils._InstanceType = None#
- core.utils._PipelineStepType = None#
- core.utils._ReturnType = None#
- core.utils.pipe(instance: core.utils._InstanceType, *functions: core.utils._PipelineStepType) core.utils._ReturnType#
Allows to compose a value and up to multiple functions that use this value.
All starts with the value itself. Each next function uses the previous result as an input parameter.
Currently,
pipehas a hard limit of 21 steps. Because, it is not possible to type it otherwise. We need a hard limit. See: dry-python/returns#461Here’s how it should be used:
>>> # => executes: str(float(int('1'))) >>> assert pipe('1', int, float, str) == '1.0'
- See also:
- Note:
- Vendored from:
- Edits:
Reduced irrelevant info in the docstring content to avoid confusion.
Renamed “flow” to “pipe”.