stdlib: add argument default values (#9501)

This commit is contained in:
Jelle Zijlstra
2023-01-18 00:37:34 -08:00
committed by GitHub
parent 6cb934291f
commit ddfaca3200
272 changed files with 2529 additions and 2467 deletions

View File

@@ -11,18 +11,18 @@ _LockLike: TypeAlias = Lock | RLock
class Barrier(threading.Barrier):
def __init__(
self, parties: int, action: Callable[[], object] | None = ..., timeout: float | None = ..., *ctx: BaseContext
self, parties: int, action: Callable[[], object] | None = None, timeout: float | None = None, *ctx: BaseContext
) -> None: ...
class BoundedSemaphore(Semaphore):
def __init__(self, value: int = ..., *, ctx: BaseContext) -> None: ...
def __init__(self, value: int = 1, *, ctx: BaseContext) -> None: ...
class Condition(AbstractContextManager[bool]):
def __init__(self, lock: _LockLike | None = ..., *, ctx: BaseContext) -> None: ...
def notify(self, n: int = ...) -> None: ...
def __init__(self, lock: _LockLike | None = None, *, ctx: BaseContext) -> None: ...
def notify(self, n: int = 1) -> None: ...
def notify_all(self) -> None: ...
def wait(self, timeout: float | None = ...) -> bool: ...
def wait_for(self, predicate: Callable[[], bool], timeout: float | None = ...) -> bool: ...
def wait(self, timeout: float | None = None) -> bool: ...
def wait_for(self, predicate: Callable[[], bool], timeout: float | None = None) -> bool: ...
def acquire(self, block: bool = ..., timeout: float | None = ...) -> bool: ...
def release(self) -> None: ...
def __exit__(
@@ -34,7 +34,7 @@ class Event:
def is_set(self) -> bool: ...
def set(self) -> None: ...
def clear(self) -> None: ...
def wait(self, timeout: float | None = ...) -> bool: ...
def wait(self, timeout: float | None = None) -> bool: ...
class Lock(SemLock):
def __init__(self, *, ctx: BaseContext) -> None: ...
@@ -43,7 +43,7 @@ class RLock(SemLock):
def __init__(self, *, ctx: BaseContext) -> None: ...
class Semaphore(SemLock):
def __init__(self, value: int = ..., *, ctx: BaseContext) -> None: ...
def __init__(self, value: int = 1, *, ctx: BaseContext) -> None: ...
# Not part of public API
class SemLock(AbstractContextManager[bool]):