Skip to content

Commit

Permalink
update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
p9f committed Mar 21, 2024
1 parent 09ef908 commit e16c2b4
Show file tree
Hide file tree
Showing 4 changed files with 145 additions and 158 deletions.
23 changes: 8 additions & 15 deletions iter_pipes/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,11 @@ def f(data: Iterable[V]) -> Iterable[U]:


@overload
def filter(step: Callable[[V], TypeGuard[W]]) -> Step[V, W]:
...
def filter(step: Callable[[V], TypeGuard[W]]) -> Step[V, W]: ...


@overload
def filter(step: Callable[[V], bool]) -> Step[V, V]:
...
def filter(step: Callable[[V], bool]) -> Step[V, V]: ...


def filter(step: Callable[[V], bool]) -> Step[V, V]: # type: ignore
Expand All @@ -98,8 +96,7 @@ def branch(
step2: Step[T, V],
pick_first: Literal[True],
max_inflight: int | None = ...,
) -> Step[T, U]:
...
) -> Step[T, U]: ...


@overload
Expand All @@ -108,8 +105,7 @@ def branch(
step2: Step[T, V],
pick_first: Literal[False] | None,
max_inflight: int | None = ...,
) -> Step[T, V | U]:
...
) -> Step[T, V | U]: ...


@overload
Expand All @@ -119,29 +115,26 @@ def branch(
step3: Step[T, W],
pick_first: Literal[False] | None,
max_inflight: int | None = ...,
) -> Step[T, V | U | W]:
...
) -> Step[T, V | U | W]: ...


@overload
def branch( # noqa: PLR0913
def branch(
step1: Step[T, U],
step2: Step[T, V],
step3: Step[T, W],
step4: Step[T, X],
pick_first: Literal[False] | None,
max_inflight: int | None = ...,
) -> Step[T, V | U | W | X]:
...
) -> Step[T, V | U | W | X]: ...


@overload
def branch(
*steps: Step[T, Any] | None,
pick_first: Literal[False] | None,
max_inflight: int | None = ...,
) -> Step[T, Any]:
...
) -> Step[T, Any]: ...


def branch( # type: ignore
Expand Down
20 changes: 7 additions & 13 deletions iter_pipes/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,10 @@ def batch(
return self | batch(step, batch_size)

@overload
def filter(self, step: Callable[[U_co], TypeGuard[W]]) -> Pipeline[T_contra, W]:
...
def filter(self, step: Callable[[U_co], TypeGuard[W]]) -> Pipeline[T_contra, W]: ...

@overload
def filter(self, step: Callable[[U_co], bool]) -> Pipeline[T_contra, U_co]:
...
def filter(self, step: Callable[[U_co], bool]) -> Pipeline[T_contra, U_co]: ...

def filter(self, step): # type: ignore
return self | filter(step) # type: ignore
Expand All @@ -110,17 +108,15 @@ def branch(
self,
f1: Callable[[Pipeline[U_co, U_co]], Pipeline[U_co, W]],
max_inflight: int = ...,
) -> Pipeline[U_co, W]:
...
) -> Pipeline[U_co, W]: ...

@overload
def branch(
self,
f1: Callable[[Pipeline[U_co, U_co]], Pipeline[U_co, V]],
f2: Callable[[Pipeline[U_co, U_co]], Pipeline[U_co, W]],
max_inflight: int = ...,
) -> Pipeline[U_co, W | V]:
...
) -> Pipeline[U_co, W | V]: ...

@overload
def branch(
Expand All @@ -129,19 +125,17 @@ def branch(
f2: Callable[[Pipeline[U_co, U_co]], Pipeline[U_co, W]],
f3: Callable[[Pipeline[U_co, U_co]], Pipeline[U_co, X]],
max_inflight: int = ...,
) -> Pipeline[U_co, W | V | X]:
...
) -> Pipeline[U_co, W | V | X]: ...

@overload
def branch( # noqa W291
def branch( # W291
self,
f1: Callable[[Pipeline[U_co, U_co]], Pipeline[U_co, V]],
f2: Callable[[Pipeline[U_co, U_co]], Pipeline[U_co, W]],
f3: Callable[[Pipeline[U_co, U_co]], Pipeline[U_co, X]],
f4: Callable[[Pipeline[U_co, U_co]], Pipeline[U_co, Y]],
max_inflight: int = ...,
) -> Pipeline[U_co, W | V | X | Y]:
...
) -> Pipeline[U_co, W | V | X | Y]: ...

def branch( # type: ignore
self,
Expand Down
Loading

0 comments on commit e16c2b4

Please # to comment.