U
vi" @ s d dl mZmZmZmZmZmZ d dlmZm Z d dlm
Z d dlm
Z
d dlmZ edZedZe
feeef eeee
f eee gee f dd d
Zd
gZdS ) )AnyCallableTypeTypeVarUnioncast)
Observablecompose) operators)NotSet)Accumulator_T_TState)accumulatorseedreturnc C sT |t k r2tt|}tj| |d}t|tj|dS ttttttf | t S )a Applies an accumulator function over an observable sequence,
returning the result of the aggregation as a single element in the
result sequence. The specified seed value is used as the initial
accumulator value.
For aggregation behavior with incremental intermediate results, see
`scan()`.
Examples:
>>> res = reduce(lambda acc, x: acc + x)
>>> res = reduce(lambda acc, x: acc + x, 0)
Args:
accumulator: An accumulator function to be
invoked on each element.
seed: Optional initial accumulator value.
Returns:
An operator function that takes an observable source and returns
an observable sequence containing a single element with the
final accumulator value.
)r )
default_value)
r r r opsscanr Zlast_or_defaultr r
last)r r Zseed_scanner r L/opt/alt/python38/lib/python3.8/site-packages/reactivex/operators/_reduce.pyreduce_ s
r N)typingr r r r r r Z reactivexr r r
r Zreactivex.internal.utilsr Zreactivex.typingr r
r r __all__r r r r