From 8c5b75e4eb928314cb1bdb18d7148685ed0ae0e3 Mon Sep 17 00:00:00 2001 From: Wojusensei Date: Tue, 7 Jul 2026 21:25:17 +0800 Subject: [PATCH 1/3] gh-152798: update sys.thread_info.lock documentation t match implementation. --- Doc/library/sys.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index d0fe0625deb513..034c5d8d89dec3 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -2240,9 +2240,8 @@ always available. Unless explicitly noted otherwise, all variables are read-only The name of the lock implementation: - * ``"semaphore"``: a lock uses a semaphore - * ``"mutex+cond"``: a lock uses a mutex and a condition variable - * ``None`` if this information is unknown + * ``"pymutex"``: a lock uses the PyMutex implementation + * ``None`` if the lock implementation is not exposed (e.g. : on Windows and WASI) .. attribute:: thread_info.version From cf2d4ad002bde93421ccb7d5b1400ac738be79b3 Mon Sep 17 00:00:00 2001 From: Wojusensei Date: Tue, 7 Jul 2026 23:12:27 +0800 Subject: [PATCH 2/3] gh-153263: keep historical lock names and clarify pymutex in docs --- Doc/library/sys.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index 034c5d8d89dec3..ba82329befcdc5 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -2240,8 +2240,10 @@ always available. Unless explicitly noted otherwise, all variables are read-only The name of the lock implementation: - * ``"pymutex"``: a lock uses the PyMutex implementation - * ``None`` if the lock implementation is not exposed (e.g. : on Windows and WASI) + * ``"semaphore"``: a lock uses a semaphore (Python 3.14 and older) + * ``"mutex+cond"``: a lock uses a mutex and a condition variable (Python 3.14 and older) + * ``"pymutex"``: a lock uses the PyMutex implementation (Python 3.15 and newer) + * ``None`` if this information is unknown .. attribute:: thread_info.version From 05c53e5156d8dc713899358a85310eb3757828fb Mon Sep 17 00:00:00 2001 From: Wojusensei Date: Tue, 7 Jul 2026 23:30:43 +0800 Subject: [PATCH 3/3] gh-153263: docs: add PyMutex cross-reference in sys.thread_info.lock --- Doc/library/sys.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index ba82329befcdc5..9a41e406c8c10e 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -2242,7 +2242,7 @@ always available. Unless explicitly noted otherwise, all variables are read-only * ``"semaphore"``: a lock uses a semaphore (Python 3.14 and older) * ``"mutex+cond"``: a lock uses a mutex and a condition variable (Python 3.14 and older) - * ``"pymutex"``: a lock uses the PyMutex implementation (Python 3.15 and newer) + * ``"pymutex"``: a lock uses the :c:type:`PyMutex` implementation (Python 3.15 and newer) * ``None`` if this information is unknown .. attribute:: thread_info.version