[Python-checkins] bpo-25821: Fix inaccuracy in threading.enumerate/is_alive documentation (GH-23192) (#26035)
iritkatriel
webhook-mailer at python.org
Tue May 11 14:19:44 EDT 2021
https://github.com/python/cpython/commit/7bef7a180da56e0399f4dec2c992bb101470fc73
commit: 7bef7a180da56e0399f4dec2c992bb101470fc73
branch: 3.10
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: iritkatriel <iritkatriel at yahoo.com>
date: 2021年05月11日T19:19:27+01:00
summary:
bpo-25821: Fix inaccuracy in threading.enumerate/is_alive documentation (GH-23192) (#26035)
(cherry picked from commit 12e7d10dfd28d4e26304e2c06b2e41c7418ec6f3)
Co-authored-by: Irit Katriel <iritkatriel at yahoo.com>
files:
M Doc/library/threading.rst
M Lib/threading.py
diff --git a/Doc/library/threading.rst b/Doc/library/threading.rst
index 16f23c3a0c3548..8c7664328a49df 100644
--- a/Doc/library/threading.rst
+++ b/Doc/library/threading.rst
@@ -121,10 +121,11 @@ This module defines the following functions:
.. function:: enumerate()
- Return a list of all :class:`Thread` objects currently alive. The list
- includes daemonic threads, dummy thread objects created by
- :func:`current_thread`, and the main thread. It excludes terminated threads
- and threads that have not yet been started.
+ Return a list of all :class:`Thread` objects currently active. The list
+ includes daemonic threads and dummy thread objects created by
+ :func:`current_thread`. It excludes terminated threads and threads
+ that have not yet been started. However, the main thread is always part
+ of the result, even when terminated.
.. function:: main_thread()
diff --git a/Lib/threading.py b/Lib/threading.py
index 4dcf84715c439d..fb70abd17aff8b 100644
--- a/Lib/threading.py
+++ b/Lib/threading.py
@@ -1130,8 +1130,8 @@ def is_alive(self):
"""Return whether the thread is alive.
This method returns True just before the run() method starts until just
- after the run() method terminates. The module function enumerate()
- returns a list of all alive threads.
+ after the run() method terminates. See also the module function
+ enumerate().
"""
assert self._initialized, "Thread.__init__() not called"
More information about the Python-checkins
mailing list