Skip to content

Commit 10c43c2

Browse files
Boudewijn26MainRo
authored andcommitted
Fix starmap_indexed not passing index
1 parent acfba97 commit 10c43c2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Diff for: reactivex/operators/__init__.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -3228,16 +3228,16 @@ def starmap_indexed(
32283228
invoking the indexed mapper function with unpacked elements
32293229
of the source.
32303230
"""
3231-
from ._map import map_
3231+
from ._map import map_indexed_
32323232

32333233
if mapper is None:
32343234
return compose(identity)
32353235

3236-
def starred(values: Tuple[Any, ...]) -> Any:
3236+
def starred(values: Tuple[Any, ...], i: int) -> Any:
32373237
assert mapper # mypy is paranoid
3238-
return mapper(*values)
3238+
return mapper(*values, i)
32393239

3240-
return compose(map_(starred))
3240+
return compose(map_indexed_(starred))
32413241

32423242

32433243
def start_with(*args: _T) -> Callable[[Observable[_T]], Observable[_T]]:

Diff for: reactivex/operators/_map.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def _identity(value: _T1, _: int) -> _T2:
6565

6666
return compose(
6767
ops.zip_with_iterable(infinite()),
68-
ops.starmap_indexed(_mapper_indexed),
68+
ops.starmap(_mapper_indexed),
6969
)
7070

7171

0 commit comments

Comments
 (0)