mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
stdlib: Add several missing @abstractmethod decorators (#7443)
This commit is contained in:
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user