dbrattli / dbrattli/aioreactive

rx.reduce should yield the initial value for an empty input

Open
#61 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
401
Forks
25
PR merge metrics
No merged PRs in 30d

Description

Operators on observables should act the same way as similar operators on collections. That includes emulating their behaviors for edge cases.

A reduce operator with an initial value on an empty list will return the initial value, so the same should apply to `rx.reduce` when applied to an empty observable – one that closes before emitting a value.

This can be achieved by emitting the initial value when the observable completes if no other value has been emitted.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the rx.reduce operator and inspect its completion behavior when the source has emitted no values. Compare the empty-input behavior described for collection reduce operations; done means an empty observable with an initial value emits that value before completing.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
stream-processing
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.