Skip to content

Commit d9e3287

Browse files
committed
refactor(pipeline): use PEP 695 generic function syntax
1 parent 215c1f0 commit d9e3287

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎other/pipeline.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
from collections.abc import Callable, Sequence
2-
from typing import Any, TypeVar
3-
4-
T = TypeVar("T")
2+
from typing import Any
53

64

75
class Pipeline:
@@ -33,7 +31,9 @@ def __init__(self, f_ls: Sequence[Callable] | None = None) -> None:
3331
def __or__(self, other: Callable) -> "Pipeline":
3432
return Pipeline(f_ls=[*self._f_ls, other])
3533

36-
def __call__(self, input_object: T, f_ls_: Sequence[Callable] | None = None) -> Any:
34+
def __call__[T](
35+
self, input_object: T, f_ls_: Sequence[Callable] | None = None
36+
) -> Any:
3737
f_ls = f_ls_ or self._f_ls
3838
if len(f_ls) == 1:
3939
return f_ls[0](input_object)

0 commit comments

Comments
 (0)