stdlib: Audit Callable[<parameters>, None] annotations (#8187)

This commit is contained in:
Alex Waygood
2022-06-27 07:08:28 +01:00
committed by GitHub
parent 0178a0e742
commit 8b3b6bf7cd
21 changed files with 59 additions and 66 deletions

View File

@@ -111,7 +111,7 @@ if sys.version_info >= (3, 11):
def _process_worker(
call_queue: Queue[_CallItem],
result_queue: SimpleQueue[_ResultItem],
initializer: Callable[..., None] | None,
initializer: Callable[..., object] | None,
initargs: tuple[Any, ...],
max_tasks: int | None = ...,
) -> None: ...
@@ -120,7 +120,7 @@ elif sys.version_info >= (3, 7):
def _process_worker(
call_queue: Queue[_CallItem],
result_queue: SimpleQueue[_ResultItem],
initializer: Callable[..., None] | None,
initializer: Callable[..., object] | None,
initargs: tuple[Any, ...],
) -> None: ...
@@ -184,7 +184,7 @@ class ProcessPoolExecutor(Executor):
self,
max_workers: int | None = ...,
mp_context: BaseContext | None = ...,
initializer: Callable[..., None] | None = ...,
initializer: Callable[..., object] | None = ...,
initargs: tuple[Any, ...] = ...,
*,
max_tasks_per_child: int | None = ...,
@@ -194,7 +194,7 @@ class ProcessPoolExecutor(Executor):
self,
max_workers: int | None = ...,
mp_context: BaseContext | None = ...,
initializer: Callable[..., None] | None = ...,
initializer: Callable[..., object] | None = ...,
initargs: tuple[Any, ...] = ...,
) -> None: ...
else:

View File

@@ -32,7 +32,7 @@ if sys.version_info >= (3, 7):
def _worker(
executor_reference: ref[Any],
work_queue: queue.SimpleQueue[Any],
initializer: Callable[..., None],
initializer: Callable[..., object],
initargs: tuple[Any, ...],
) -> None: ...
@@ -63,7 +63,7 @@ class ThreadPoolExecutor(Executor):
self,
max_workers: int | None = ...,
thread_name_prefix: str = ...,
initializer: Callable[..., None] | None = ...,
initializer: Callable[..., object] | None = ...,
initargs: tuple[Any, ...] = ...,
) -> None: ...
else: