mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
#5031: fix Thread.daemon property docs.
This commit is contained in:
parent
85c5ccfab9
commit
ecd2afa452
1 changed files with 6 additions and 5 deletions
|
@ -210,7 +210,7 @@ changed through the :attr:`name` attribute.
|
||||||
A thread can be flagged as a "daemon thread". The significance of this flag is
|
A thread can be flagged as a "daemon thread". The significance of this flag is
|
||||||
that the entire Python program exits when only daemon threads are left. The
|
that the entire Python program exits when only daemon threads are left. The
|
||||||
initial value is inherited from the creating thread. The flag can be set
|
initial value is inherited from the creating thread. The flag can be set
|
||||||
through the :attr:`daemon` attribute.
|
through the :attr:`daemon` property.
|
||||||
|
|
||||||
There is a "main thread" object; this corresponds to the initial thread of
|
There is a "main thread" object; this corresponds to the initial thread of
|
||||||
control in the Python program. It is not a daemon thread.
|
control in the Python program. It is not a daemon thread.
|
||||||
|
@ -332,10 +332,11 @@ impossible to detect the termination of alien threads.
|
||||||
|
|
||||||
.. attribute:: Thread.daemon
|
.. attribute:: Thread.daemon
|
||||||
|
|
||||||
The thread's daemon flag. This must be set before :meth:`start` is called,
|
A boolean value indicating whether this thread is a daemon thread (True) or
|
||||||
otherwise :exc:`RuntimeError` is raised.
|
not (False). This must be set before :meth:`start` is called, otherwise
|
||||||
|
:exc:`RuntimeError` is raised. Its initial value is inherited from the
|
||||||
The initial value is inherited from the creating thread.
|
creating thread; the main thread is not a daemon thread and therefore all
|
||||||
|
threads created in the main thread default to :attr:`daemon` = ``False``.
|
||||||
|
|
||||||
The entire Python program exits when no alive non-daemon threads are left.
|
The entire Python program exits when no alive non-daemon threads are left.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue