stdlib: Add several missing @abstractmethod decorators (#7443)

This commit is contained in:
Alex Waygood
2022-03-07 00:41:13 +00:00
committed by GitHub
parent 2fb9c35ff9
commit 947724a5cb
7 changed files with 29 additions and 4 deletions

View File

@@ -2,6 +2,7 @@ import sys
import threading
from contextlib import AbstractContextManager
from multiprocessing.context import BaseContext
from types import TracebackType
from typing import Any, Callable, Union
__all__ = ["Lock", "RLock", "Semaphore", "BoundedSemaphore", "Condition", "Event"]
@@ -28,8 +29,11 @@ class Condition(AbstractContextManager[bool]):
def wait_for(self, predicate: Callable[[], bool], timeout: float | None = ...) -> bool: ...
def acquire(self, block: bool = ..., timeout: float | None = ...) -> bool: ...
def release(self) -> None: ...
def __exit__(
self, __exc_type: type[BaseException] | None, __exc_val: BaseException | None, __exc_tb: TracebackType | None
) -> None: ...
class Event(AbstractContextManager[bool]):
class Event:
def __init__(self, lock: _LockLike | None = ..., *, ctx: BaseContext) -> None: ...
def is_set(self) -> bool: ...
def set(self) -> None: ...
@@ -49,3 +53,6 @@ class Semaphore(SemLock):
class SemLock(AbstractContextManager[bool]):
def acquire(self, block: bool = ..., timeout: float | None = ...) -> bool: ...
def release(self) -> None: ...
def __exit__(
self, __exc_type: type[BaseException] | None, __exc_val: BaseException | None, __exc_tb: TracebackType | None
) -> None: ...