Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multiprocessing: audit callback annotations #8178

Merged
merged 1 commit into from
Jun 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions stdlib/multiprocessing/pool.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ _T = TypeVar("_T")
class ApplyResult(Generic[_T]):
if sys.version_info >= (3, 8):
def __init__(
self, pool: Pool, callback: Callable[[_T], None] | None, error_callback: Callable[[BaseException], None] | None
self, pool: Pool, callback: Callable[[_T], object] | None, error_callback: Callable[[BaseException], object] | None
) -> None: ...
else:
def __init__(
self,
cache: dict[int, ApplyResult[Any]],
callback: Callable[[_T], None] | None,
error_callback: Callable[[BaseException], None] | None,
callback: Callable[[_T], object] | None,
error_callback: Callable[[BaseException], object] | None,
) -> None: ...

def get(self, timeout: float | None = ...) -> _T: ...
Expand All @@ -43,17 +43,17 @@ class MapResult(ApplyResult[list[_T]]):
pool: Pool,
chunksize: int,
length: int,
callback: Callable[[list[_T]], None] | None,
error_callback: Callable[[BaseException], None] | None,
callback: Callable[[list[_T]], object] | None,
error_callback: Callable[[BaseException], object] | None,
) -> None: ...
else:
def __init__(
self,
cache: dict[int, ApplyResult[Any]],
chunksize: int,
length: int,
callback: Callable[[list[_T]], None] | None,
error_callback: Callable[[BaseException], None] | None,
callback: Callable[[list[_T]], object] | None,
error_callback: Callable[[BaseException], object] | None,
) -> None: ...

class IMapIterator(Iterator[_T]):
Expand Down Expand Up @@ -83,17 +83,17 @@ class Pool:
func: Callable[..., _T],
args: Iterable[Any] = ...,
kwds: Mapping[str, Any] = ...,
callback: Callable[[_T], None] | None = ...,
error_callback: Callable[[BaseException], None] | None = ...,
callback: Callable[[_T], object] | None = ...,
error_callback: Callable[[BaseException], object] | None = ...,
) -> AsyncResult[_T]: ...
def map(self, func: Callable[[_S], _T], iterable: Iterable[_S], chunksize: int | None = ...) -> list[_T]: ...
def map_async(
self,
func: Callable[[_S], _T],
iterable: Iterable[_S],
chunksize: int | None = ...,
callback: Callable[[_T], None] | None = ...,
error_callback: Callable[[BaseException], None] | None = ...,
callback: Callable[[_T], object] | None = ...,
error_callback: Callable[[BaseException], object] | None = ...,
) -> MapResult[_T]: ...
def imap(self, func: Callable[[_S], _T], iterable: Iterable[_S], chunksize: int | None = ...) -> IMapIterator[_T]: ...
def imap_unordered(
Expand All @@ -105,8 +105,8 @@ class Pool:
func: Callable[..., _T],
iterable: Iterable[Iterable[Any]],
chunksize: int | None = ...,
callback: Callable[[_T], None] | None = ...,
error_callback: Callable[[BaseException], None] | None = ...,
callback: Callable[[_T], object] | None = ...,
error_callback: Callable[[BaseException], object] | None = ...,
) -> AsyncResult[list[_T]]: ...
def close(self) -> None: ...
def terminate(self) -> None: ...
Expand Down