summaryrefslogtreecommitdiffstats
path: root/Doc/library/queue.rst
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-01-03 21:18:54 (GMT)
committerGeorg Brandl <georg@python.org>2009-01-03 21:18:54 (GMT)
commit48310cd3f2e02ced9ae836ccbcb67e9af3097d62 (patch)
tree04c86b387c11bfd4835a320e76bbb2ee24626e0d /Doc/library/queue.rst
parent3d3558a4653fcfcbdcbb75bda5d61e93c48f4d51 (diff)
downloadcpython-48310cd3f2e02ced9ae836ccbcb67e9af3097d62.zip
cpython-48310cd3f2e02ced9ae836ccbcb67e9af3097d62.tar.gz
cpython-48310cd3f2e02ced9ae836ccbcb67e9af3097d62.tar.bz2
Remove trailing whitespace.
Diffstat (limited to 'Doc/library/queue.rst')
-rw-r--r--Doc/library/queue.rst20
1 files changed, 10 insertions, 10 deletions
diff --git a/Doc/library/queue.rst b/Doc/library/queue.rst
index fa09fc5..e90f276 100644
--- a/Doc/library/queue.rst
+++ b/Doc/library/queue.rst
@@ -68,7 +68,7 @@ Queue Objects
-------------
Queue objects (:class:`Queue`, :class:`LifoQueue`, or :class:`PriorityQueue`)
-provide the public methods described below.
+provide the public methods described below.
.. method:: Queue.qsize()
@@ -138,20 +138,20 @@ fully processed by daemon consumer threads.
Example of how to wait for enqueued tasks to be completed::
- def worker():
- while True:
- item = q.get()
- do_work(item)
- q.task_done()
+ def worker():
+ while True:
+ item = q.get()
+ do_work(item)
+ q.task_done()
- q = Queue()
- for i in range(num_worker_threads):
+ q = Queue()
+ for i in range(num_worker_threads):
t = Thread(target=worker)
t.set_daemon(True)
- t.start()
+ t.start()
for item in source():
- q.put(item)
+ q.put(item)
q.join() # block until all tasks are done