reducer#

class Reducer(name: str, fn: Callable[[list[T]], R])#

Bases: Generic[T, R]

A named reduction policy over a list of values.

name: str#
fn: Callable[[list[T]], R]#
last_or_none(values: list[T]) T | None#
first_or_none(values: list[T]) T | None#
any_true(values: list[bool]) bool#
all_true(values: list[bool]) bool#
identity(values: list[T]) list[T]#
concat(values: Sequence[Iterable[T]]) list[T]#
unique(values: list[T]) list[T]#
merge_dicts(values: list[dict[str, Any]]) dict[str, Any]#