Skip to content

chain(steps, default=None)

Execute pipeline steps sequentially with an initial value.

Each step receives the result of the previous step as its first positional argument.

Args:
steps: An iterable of pipeline steps to execute in order.
default: Initial value passed to the first step.
Defaults to None.

Returns:
The result produced by the last step, or default if no steps are configured.

Raises:
TypeError: If any step has an invalid format.