Skip to content

Commit

Permalink
Use naming convention for operator implementations
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrattli committed Feb 20, 2022
1 parent 95f58ea commit 2716a45
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
7 changes: 3 additions & 4 deletions rx/core/operators/map.py
Expand Up @@ -10,8 +10,7 @@
_T2 = TypeVar("_T2")


# pylint: disable=redefined-builtin
def map(
def map_(
mapper: Optional[Mapper[_T1, _T2]] = None
) -> Callable[[Observable[_T1]], Observable[_T2]]:

Expand Down Expand Up @@ -55,7 +54,7 @@ def on_next(value: _T1) -> None:
return map


def map_indexed(
def map_indexed_(
mapper_indexed: Optional[MapperIndexed[_T1, _T2]] = None
) -> Callable[[Observable[_T1]], Observable[_T2]]:
def _identity(value: _T1, _: int) -> _T2:
Expand All @@ -69,4 +68,4 @@ def _identity(value: _T1, _: int) -> _T2:
)


__all__ = ["map", "map_indexed"]
__all__ = ["map_", "map_indexed_"]
8 changes: 4 additions & 4 deletions rx/operators/__init__.py
Expand Up @@ -1777,9 +1777,9 @@ def map(
the result of invoking the transform function on each element
of the source.
"""
from rx.core.operators.map import map
from rx.core.operators.map import map_

return map(mapper)
return map_(mapper)


def map_indexed(
Expand Down Expand Up @@ -1809,9 +1809,9 @@ def map_indexed(
the result of invoking the transform function on each element
of the source.
"""
from rx.core.operators.map import map_indexed
from rx.core.operators.map import map_indexed_

return map_indexed(mapper_indexed)
return map_indexed_(mapper_indexed)


def materialize() -> Callable[[Observable[_T]], Observable[Notification[_T]]]:
Expand Down

0 comments on commit 2716a45

Please sign in to comment.