Improve multiprocessing stubs (#8202)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
This commit is contained in:
Alex Waygood
2022-07-01 19:20:39 +01:00
committed by GitHub
parent 7b54854c90
commit a2e8346d9a
8 changed files with 56 additions and 90 deletions

View File

@@ -4,7 +4,6 @@ from collections.abc import Callable
from contextlib import AbstractContextManager
from multiprocessing.context import BaseContext
from types import TracebackType
from typing import Any
from typing_extensions import TypeAlias
__all__ = ["Lock", "RLock", "Semaphore", "BoundedSemaphore", "Condition", "Event"]
@@ -13,7 +12,7 @@ _LockLike: TypeAlias = Lock | RLock
class Barrier(threading.Barrier):
def __init__(
self, parties: int, action: Callable[..., Any] | None = ..., timeout: float | None = ..., *ctx: BaseContext
self, parties: int, action: Callable[[], object] | None = ..., timeout: float | None = ..., *ctx: BaseContext
) -> None: ...
class BoundedSemaphore(Semaphore):