threading.Semaphore: add _value (#7952)

I've had occasion to use this multiple times. We already have _value for
asyncio.locks.Semaphore See also
https://github.com/python/cpython/issues/93213

Co-authored-by: hauntsaninja <>
This commit is contained in:
Shantanu
2022-05-25 14:24:09 -07:00
committed by GitHub
parent afb512f38b
commit c8f9abf41d

View File

@@ -190,6 +190,7 @@ class Condition:
def notifyAll(self) -> None: ... # deprecated alias for notify_all()
class Semaphore:
_value: int
def __init__(self, value: int = ...) -> None: ...
def __exit__(self, t: type[BaseException] | None, v: BaseException | None, tb: TracebackType | None) -> None: ...
def acquire(self, blocking: bool = ..., timeout: float | None = ...) -> bool: ...