]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-25821: Fix inaccuracy in threading.enumerate/is_alive documentation (GH-23192...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 11 May 2021 18:19:42 +0000 (11:19 -0700)
committerGitHub <noreply@github.com>
Tue, 11 May 2021 18:19:42 +0000 (19:19 +0100)
(cherry picked from commit 12e7d10dfd28d4e26304e2c06b2e41c7418ec6f3)

Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>
Doc/library/threading.rst
Lib/threading.py

index 2a42018b7bfc74f07c9774387475f82e11ff00a4..894bbb11da9152d3421a5cde764da5d81a28a2fe 100644 (file)
@@ -110,10 +110,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()
index d96d99a713e90432155acdc1f9c8f08ff52e0f08..4da5c657b1b73a098df5f6918075908e94362c58 100644 (file)
@@ -1094,8 +1094,8 @@ class Thread:
         """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"