bpo-25821: Fix inaccuracy in threading.enumerate/is_alive documentation (GH-23192) (#26036)

(cherry picked from commit 12e7d10dfd)

Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>
This commit is contained in:
Miss Islington (bot) 2021-05-11 11:19:42 -07:00 committed by GitHub
parent 1d8c18019d
commit bde14f7fbd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 6 deletions

View 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()

View 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"