-
Notifications
You must be signed in to change notification settings - Fork 364
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix starmap_indexed not passing index #690
base: master
Are you sure you want to change the base?
Conversation
@@ -65,7 +65,7 @@ def _identity(value: _T1, _: int) -> _T2: | |||
|
|||
return compose( | |||
ops.zip_with_iterable(infinite()), | |||
ops.starmap_indexed(_mapper_indexed), | |||
ops.starmap(_mapper_indexed), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This depended on the incorrect behavior of starmap_indexed
. If it actually were to pass the index, it would pass it twice: once from zip_with_iterable(infinite())
and once from starmap_indexed
@@ -405,6 +405,211 @@ def mapper(x, y): | |||
assert xs.subscriptions == [subscribe(200, 290)] | |||
assert invoked[0] == 3 | |||
|
|||
def test_starmap_with_index_throws(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests derived from
RxPY/tests/test_observable/test_map.py
Line 265 in 8263b1e
def test_map_with_index_throws(self): |
13100f7
to
cab78b4
Compare
cab78b4
to
b6ffaff
Compare
This PR fixes
starmap_indexed
not actually passing the index to the functionThis could be considered a breaking change, although I suspect the impact would be minor. Anyone currently using
starmap_indexed
must have noticed it's no different fromstarmap