mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 21:14:48 +08:00
Make ExitStack, AbstractContextManager and AsyncAbstractContextManager generic in return type of __exit__ (#11048)
This commit is contained in:
@@ -14,7 +14,7 @@ class Barrier(threading.Barrier):
|
||||
self, parties: int, action: Callable[[], object] | None = None, timeout: float | None = None, *ctx: BaseContext
|
||||
) -> None: ...
|
||||
|
||||
class Condition(AbstractContextManager[bool]):
|
||||
class Condition(AbstractContextManager[bool, None]):
|
||||
def __init__(self, lock: _LockLike | None = None, *, ctx: BaseContext) -> None: ...
|
||||
def notify(self, n: int = 1) -> None: ...
|
||||
def notify_all(self) -> None: ...
|
||||
@@ -34,7 +34,7 @@ class Event:
|
||||
def wait(self, timeout: float | None = None) -> bool: ...
|
||||
|
||||
# Not part of public API
|
||||
class SemLock(AbstractContextManager[bool]):
|
||||
class SemLock(AbstractContextManager[bool, None]):
|
||||
def acquire(self, block: bool = ..., timeout: float | None = ...) -> bool: ...
|
||||
def release(self) -> None: ...
|
||||
def __exit__(
|
||||
|
||||
Reference in New Issue
Block a user