Skip to content

Commit

Permalink
<py311
Browse files Browse the repository at this point in the history
  • Loading branch information
artemisart committed Feb 5, 2024
1 parent 42f0b25 commit c67ee04
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions functional/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,13 @@
NoReturn,
Optional,
TypeVar,
TypeVarTuple,
Union,
cast,
overload,
)

from tabulate import tabulate
from typing_extensions import Self
from typing_extensions import Self, TypeVarTuple, Unpack

from functional import transformations
from functional.execution import ExecutionEngine, ExecutionStrategies
Expand Down Expand Up @@ -555,7 +554,9 @@ def select(self, func: Callable[[T], U]) -> Sequence[U]:
"""Alias for map."""
return self.map(func)

def starmap(self: Sequence[tuple[*Ts]], func: Callable[[*Ts], U]) -> Sequence[U]:
def starmap(
self: Sequence[tuple[Unpack[Ts]]], func: Callable[[Unpack[Ts]], U]
) -> Sequence[U]:
"""
starmaps f onto the sequence as itertools.starmap does.
Expand All @@ -567,7 +568,9 @@ def starmap(self: Sequence[tuple[*Ts]], func: Callable[[*Ts], U]) -> Sequence[U]
"""
return self._transform(transformations.starmap_t(func))

def smap(self: Sequence[tuple[*Ts]], func: Callable[[*Ts], U]) -> Sequence[U]:
def smap(
self: Sequence[tuple[Unpack[Ts]]], func: Callable[[Unpack[Ts]], U]
) -> Sequence[U]:
"""
Alias to Sequence.starmap
Expand Down

0 comments on commit c67ee04

Please sign in to comment.