mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +00:00
bpo-41833: threading.Thread now uses the target name (GH-22357)
This commit is contained in:
parent
2e4dd336e5
commit
98c16c991d
4 changed files with 55 additions and 10 deletions
|
@ -264,8 +264,10 @@ since it is impossible to detect the termination of alien threads.
|
|||
*target* is the callable object to be invoked by the :meth:`run` method.
|
||||
Defaults to ``None``, meaning nothing is called.
|
||||
|
||||
*name* is the thread name. By default, a unique name is constructed of the
|
||||
form "Thread-*N*" where *N* is a small decimal number.
|
||||
*name* is the thread name. By default, a unique name is constructed
|
||||
of the form "Thread-*N*" where *N* is a small decimal number,
|
||||
or "Thread-*N* (target)" where "target" is ``target.__name__`` if the
|
||||
*target* argument is specified.
|
||||
|
||||
*args* is the argument tuple for the target invocation. Defaults to ``()``.
|
||||
|
||||
|
@ -280,6 +282,9 @@ since it is impossible to detect the termination of alien threads.
|
|||
base class constructor (``Thread.__init__()``) before doing anything else to
|
||||
the thread.
|
||||
|
||||
.. versionchanged:: 3.10
|
||||
Use the *target* name if *name* argument is omitted.
|
||||
|
||||
.. versionchanged:: 3.3
|
||||
Added the *daemon* argument.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue