GeezerVison is showing github.com — bpo-25821: Fix inaccuracy in threading.enumerate/is_alive documentati… · python/cpython@12e7d10
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: Doc/library/threading.rst +5-4Lines changed: 5 additions & 4 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -121,10 +121,11 @@ This module defines the following functions: |
121 | 121 |
|
122 | 122 | .. function:: enumerate() |
123 | 123 |
|
124 | | - Return a list of all :class:`Thread` objects currently alive. The list |
125 | | - includes daemonic threads, dummy thread objects created by |
126 | | - :func:`current_thread`, and the main thread. It excludes terminated threads |
127 | | - and threads that have not yet been started. |
| 124 | + Return a list of all :class:`Thread` objects currently active. The list |
| 125 | + includes daemonic threads and dummy thread objects created by |
| 126 | + :func:`current_thread`. It excludes terminated threads and threads |
| 127 | + that have not yet been started. However, the main thread is always part |
| 128 | + of the result, even when terminated. |
128 | 129 |
|
129 | 130 |
|
130 | 131 | .. function:: main_thread() |
|
Collapse file
Copy file name to clipboardExpand all lines: Lib/threading.py +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -1130,8 +1130,8 @@ def is_alive(self): |
1130 | 1130 | """Return whether the thread is alive. |
1131 | 1131 |
|
1132 | 1132 | This method returns True just before the run() method starts until just |
1133 | | - after the run() method terminates. The module function enumerate() |
1134 | | - returns a list of all alive threads. |
| 1133 | + after the run() method terminates. See also the module function |
| 1134 | + enumerate(). |
1135 | 1135 |
|
1136 | 1136 | """ |
1137 | 1137 | assert self._initialized, "Thread.__init__() not called" |
|