mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
threading: __exit__ only returns None (#8298)
Fixes #8297
`threading.Lock.__exit__` is implemented in C and can only return None: 6cbb57f62d/Modules/_threadmodule.c (L200)
`threading.Condition.__exit__` returns whatever its lock's `__exit__` returns, but our type annotations indicate that the lock is always a `Lock` or an `_RLock`, and neither returns anything other than None.
This commit is contained in:
@@ -106,7 +106,7 @@ class Lock:
|
||||
def __enter__(self) -> bool: ...
|
||||
def __exit__(
|
||||
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
|
||||
) -> bool | None: ...
|
||||
) -> None: ...
|
||||
def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ...
|
||||
def release(self) -> None: ...
|
||||
def locked(self) -> bool: ...
|
||||
@@ -125,7 +125,7 @@ class Condition:
|
||||
def __enter__(self) -> bool: ...
|
||||
def __exit__(
|
||||
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
|
||||
) -> bool | None: ...
|
||||
) -> None: ...
|
||||
def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ...
|
||||
def release(self) -> None: ...
|
||||
def wait(self, timeout: float | None = ...) -> bool: ...
|
||||
|
||||
Reference in New Issue
Block a user