Skip to content

Commit

Permalink
bpo-25821: Fix inaccuracy in threading.enumerate/is_alive documentati…
Browse files Browse the repository at this point in the history
…on (GH-23192) (#26035)

(cherry picked from commit 12e7d10)

Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>
  • Loading branch information
miss-islington and iritkatriel committed May 11, 2021
1 parent 9090401 commit 7bef7a1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions Doc/library/threading.rst
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions Lib/threading.py
Expand Up @@ -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"
Expand Down

0 comments on commit 7bef7a1

Please sign in to comment.