[Python-checkins] Remove print race from task_done example. (GH-31795)

rhettinger webhook-mailer at python.org
Thu Mar 10 12:01:34 EST 2022


https://github.com/python/cpython/commit/a0eb69c1a2e3aee75cb48e9868ef06a531b94a70
commit: a0eb69c1a2e3aee75cb48e9868ef06a531b94a70
branch: main
author: Raymond Hettinger <rhettinger at users.noreply.github.com>
committer: rhettinger <rhettinger at users.noreply.github.com>
date: 2022-03-10T11:01:23-06:00
summary:

Remove print race from task_done example. (GH-31795)

files:
M Doc/library/queue.rst

diff --git a/Doc/library/queue.rst b/Doc/library/queue.rst
index 0ec5900bef5bb..cbf27d2bb10d0 100644
--- a/Doc/library/queue.rst
+++ b/Doc/library/queue.rst
@@ -201,15 +201,14 @@ Example of how to wait for enqueued tasks to be completed::
             print(f'Finished {item}')
             q.task_done()
 
-    # turn-on the worker thread
+    # Turn-on the worker thread.
     threading.Thread(target=worker, daemon=True).start()
 
-    # send thirty task requests to the worker
+    # Send thirty task requests to the worker.
     for item in range(30):
         q.put(item)
-    print('All task requests sent\n', end='')
 
-    # block until all tasks are done
+    # Block until all tasks are done.
     q.join()
     print('All work completed')
 



More information about the Python-checkins mailing list