U vi"@sddlmZmZmZmZmZmZddlmZm Z ddlm Z ddl m Z ddlmZedZedZe feeefeeee feeegeefdd d Zd gZd S) )AnyCallableTypeTypeVarUnioncast) Observablecompose) operators)NotSet) Accumulator_T_TState) accumulatorseedreturncCsT|tk r2tt|}tj||d}t|tj|dSttttttf|t S)aApplies 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 rropsscanr Zlast_or_defaultr r last)rrZseed_scannerrL/opt/alt/python38/lib/python3.8/site-packages/reactivex/operators/_reduce.pyreduce_ s  rN)typingrrrrrrZ reactivexrr r rZreactivex.internal.utilsr Zreactivex.typingr r rr__all__rrrrs      '