Add overrides for threaded_parallel_map
This commit is contained in:
parent
3d4b23f7f4
commit
d5812d05ca
1 changed files with 29 additions and 3 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
import queue
|
import queue
|
||||||
import threading
|
import threading
|
||||||
from typing import Callable, Iterable, Optional, Sequence, TypeVar, overload
|
from typing import Callable, Iterable, Literal, Optional, Sequence, TypeVar, overload
|
||||||
|
|
||||||
from .get_config import get_config
|
from .get_config import get_config
|
||||||
from .manage_communication import manage_communication
|
from .manage_communication import manage_communication
|
||||||
|
|
@ -19,7 +19,7 @@ def threaded_parallel_map(
|
||||||
chunk_size: Optional[int],
|
chunk_size: Optional[int],
|
||||||
concurrency: Optional[int],
|
concurrency: Optional[int],
|
||||||
unordered: Optional[bool],
|
unordered: Optional[bool],
|
||||||
ignore_exceptions: Optional[bool],
|
ignore_exceptions: Optional[Literal[False]],
|
||||||
) -> Iterable[V]:
|
) -> Iterable[V]:
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|
@ -32,11 +32,37 @@ def threaded_parallel_map(
|
||||||
chunk_size: int,
|
chunk_size: int,
|
||||||
concurrency: Optional[int],
|
concurrency: Optional[int],
|
||||||
unordered: Optional[bool],
|
unordered: Optional[bool],
|
||||||
ignore_exceptions: Optional[bool],
|
ignore_exceptions: Optional[Literal[False]],
|
||||||
) -> Iterable[V]:
|
) -> Iterable[V]:
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|
||||||
|
@overload
|
||||||
|
def threaded_parallel_map(
|
||||||
|
function: Callable[[T], V],
|
||||||
|
input_values: Sequence[T],
|
||||||
|
*,
|
||||||
|
chunk_size: Optional[int],
|
||||||
|
concurrency: Optional[int],
|
||||||
|
unordered: Optional[bool],
|
||||||
|
ignore_exceptions: True,
|
||||||
|
) -> Iterable[Optional[V]]:
|
||||||
|
...
|
||||||
|
|
||||||
|
|
||||||
|
@overload
|
||||||
|
def threaded_parallel_map(
|
||||||
|
function: Callable[[T], V],
|
||||||
|
input_values: Iterable[T],
|
||||||
|
*,
|
||||||
|
chunk_size: int,
|
||||||
|
concurrency: Optional[int],
|
||||||
|
unordered: Optional[bool],
|
||||||
|
ignore_exceptions: True,
|
||||||
|
) -> Iterable[Optional[V]]:
|
||||||
|
...
|
||||||
|
|
||||||
|
|
||||||
def threaded_parallel_map(
|
def threaded_parallel_map(
|
||||||
function,
|
function,
|
||||||
input_values,
|
input_values,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue