[stdlib] Add locked method to threading.Condition (#15075)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
Guo Ci
2025-11-23 13:28:59 -05:00
committed by GitHub
parent cc792321dd
commit 8c7256c8fd
2 changed files with 6 additions and 0 deletions
@@ -40,6 +40,9 @@ concurrent.interpreters._queues.UNBOUND_REMOVE
importlib.util.Loader.exec_module # See Lib/importlib/_abc.py. Might be defined for backwards compatibility
# Condition functions are exported in __init__
threading.Condition.locked
multiprocessing.dummy.Condition.locked
# ====================================
# Pre-existing errors from Python 3.13
+3
View File
@@ -144,6 +144,9 @@ class Condition:
) -> None: ...
def acquire(self, blocking: bool = True, timeout: float = -1) -> bool: ...
def release(self) -> None: ...
if sys.version_info >= (3, 14):
def locked(self) -> bool: ...
def wait(self, timeout: float | None = None) -> bool: ...
def wait_for(self, predicate: Callable[[], _T], timeout: float | None = None) -> _T: ...
def notify(self, n: int = 1) -> None: ...