mirror of
https://github.com/python/cpython.git
synced 2025-09-14 20:56:06 +00:00
bpo-25821: Fix inaccuracy in threading.enumerate/is_alive documentation (GH-23192) (#26035)
(cherry picked from commit 12e7d10dfd
)
Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>
This commit is contained in:
parent
90904011bd
commit
7bef7a180d
2 changed files with 7 additions and 6 deletions
|
@ -121,10 +121,11 @@ This module defines the following functions:
|
||||||
|
|
||||||
.. function:: enumerate()
|
.. function:: enumerate()
|
||||||
|
|
||||||
Return a list of all :class:`Thread` objects currently alive. The list
|
Return a list of all :class:`Thread` objects currently active. The list
|
||||||
includes daemonic threads, dummy thread objects created by
|
includes daemonic threads and dummy thread objects created by
|
||||||
:func:`current_thread`, and the main thread. It excludes terminated threads
|
:func:`current_thread`. It excludes terminated threads and threads
|
||||||
and threads that have not yet been started.
|
that have not yet been started. However, the main thread is always part
|
||||||
|
of the result, even when terminated.
|
||||||
|
|
||||||
|
|
||||||
.. function:: main_thread()
|
.. function:: main_thread()
|
||||||
|
|
|
@ -1130,8 +1130,8 @@ class Thread:
|
||||||
"""Return whether the thread is alive.
|
"""Return whether the thread is alive.
|
||||||
|
|
||||||
This method returns True just before the run() method starts until just
|
This method returns True just before the run() method starts until just
|
||||||
after the run() method terminates. The module function enumerate()
|
after the run() method terminates. See also the module function
|
||||||
returns a list of all alive threads.
|
enumerate().
|
||||||
|
|
||||||
"""
|
"""
|
||||||
assert self._initialized, "Thread.__init__() not called"
|
assert self._initialized, "Thread.__init__() not called"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue