Skip to content

Commit bde14f7

Browse files
bpo-25821: Fix inaccuracy in threading.enumerate/is_alive documentation (GH-23192) (#26036)
(cherry picked from commit 12e7d10) Co-authored-by: Irit Katriel <[email protected]>
1 parent 1d8c180 commit bde14f7

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

Doc/library/threading.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,11 @@ This module defines the following functions:
110110

111111
.. function:: enumerate()
112112

113-
Return a list of all :class:`Thread` objects currently alive. The list
114-
includes daemonic threads, dummy thread objects created by
115-
:func:`current_thread`, and the main thread. It excludes terminated threads
116-
and threads that have not yet been started.
113+
Return a list of all :class:`Thread` objects currently active. The list
114+
includes daemonic threads and dummy thread objects created by
115+
:func:`current_thread`. It excludes terminated threads and threads
116+
that have not yet been started. However, the main thread is always part
117+
of the result, even when terminated.
117118

118119

119120
.. function:: main_thread()

Lib/threading.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,8 +1094,8 @@ def is_alive(self):
10941094
"""Return whether the thread is alive.
10951095
10961096
This method returns True just before the run() method starts until just
1097-
after the run() method terminates. The module function enumerate()
1098-
returns a list of all alive threads.
1097+
after the run() method terminates. See also the module function
1098+
enumerate().
10991099
11001100
"""
11011101
assert self._initialized, "Thread.__init__() not called"

0 commit comments

Comments
 (0)