From c8f9abf41dc93c9fad5bd0c82331957d213d99f3 Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Wed, 25 May 2022 14:24:09 -0700 Subject: [PATCH] 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 <> --- stdlib/threading.pyi | 1 + 1 file changed, 1 insertion(+) diff --git a/stdlib/threading.pyi b/stdlib/threading.pyi index 231018ca7..b9a656f21 100644 --- a/stdlib/threading.pyi +++ b/stdlib/threading.pyi @@ -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: ...