[Python-checkins] Improve threading.daemon docstring (GH-14278)

Miss Islington (bot) webhook-mailer at python.org
Sat Jun 22 08:51:11 EDT 2019

commit: bb110cc2ed81447fb48805f31146cf31323a8fc3
branch: master
author: mbarkhau <mbarkhau at gmail.com>
committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
date: 2019-06-22T05:51:06-07:00

Improve threading.daemon docstring (GH-14278)

Rephrase and clarify that "the entire Python program exits when only daemon threads are left". This matches the documentation at https://docs.python.org/3/library/threading.html#thread-objects.

M Lib/threading.py

diff --git a/Lib/threading.py b/Lib/threading.py
index 01a15a6fc075..cec9cdb8e698 100644
--- a/Lib/threading.py
+++ b/Lib/threading.py
@@ -1107,8 +1107,7 @@ def daemon(self):
         main thread is not a daemon thread and therefore all threads created in
         the main thread default to daemon = False.
-        The entire Python program exits when no alive non-daemon threads are
-        left.
+        The entire Python program exits when only daemon threads are left.
         assert self._initialized, "Thread.__init__() not called"

More information about the Python-checkins mailing list