]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-25821: Fix inaccuracy in threading.enumerate/is_alive documentation (#23192)
authorIrit Katriel <iritkatriel@yahoo.com>
Tue, 11 May 2021 17:55:24 +0000 (18:55 +0100)
committerGitHub <noreply@github.com>
Tue, 11 May 2021 17:55:24 +0000 (18:55 +0100)
Doc/library/threading.rst
Lib/threading.py

index 16f23c3a0c3548613e64e0c75ba6de9b358f97bc..8c7664328a49df91f3838d7d9768d00c25b5c65f 100644 (file)
@@ -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()
index 4dcf84715c439d2e33598aaa4d3ca308703a345c..fb70abd17aff8b04ec2c77d5b4ceae0a1c4421c9 100644 (file)
@@ -1130,8 +1130,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"