From 72bf6c051479ddea55b22ed9ca889ecb00181110 Mon Sep 17 00:00:00 2001 From: Guo Ci Date: Sun, 23 Nov 2025 13:05:52 -0500 Subject: [PATCH 1/3] [stdlib] Add `locked` method `threading.Condition` --- stdlib/threading.pyi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stdlib/threading.pyi b/stdlib/threading.pyi index 7b0f15bdfa2e..daa9e1bda428 100644 --- a/stdlib/threading.pyi +++ b/stdlib/threading.pyi @@ -144,6 +144,8 @@ 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: ... From 4dadebe8daa638ef3113a5c47949ea5093d69dd1 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 23 Nov 2025 18:08:56 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks --- stdlib/threading.pyi | 1 + 1 file changed, 1 insertion(+) diff --git a/stdlib/threading.pyi b/stdlib/threading.pyi index daa9e1bda428..8a2b68dcd1cf 100644 --- a/stdlib/threading.pyi +++ b/stdlib/threading.pyi @@ -146,6 +146,7 @@ class Condition: 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: ... From 5ad85f7279262e02b478ba89a8a4615ae8c18da7 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Sun, 23 Nov 2025 18:14:03 +0000 Subject: [PATCH 3/3] update allowlists --- stdlib/@tests/stubtest_allowlists/py314.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stdlib/@tests/stubtest_allowlists/py314.txt b/stdlib/@tests/stubtest_allowlists/py314.txt index 0fcdcbb84d97..76d0408730dd 100644 --- a/stdlib/@tests/stubtest_allowlists/py314.txt +++ b/stdlib/@tests/stubtest_allowlists/py314.txt @@ -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