Skip to content

Commit db98031

Browse files
committed
Address review feedback: remove incorrect comments and fix deadlock example
1 parent 6dd6b65 commit db98031

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Doc/library/concurrent.futures.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,8 @@ Executor Objects
4040
with ThreadPoolExecutor(max_workers=1) as executor:
4141
future = executor.submit(pow, 323, 1235)
4242
print(future.result())
43-
# Note: calling future.result() outside this with statement would work fine,
44-
# but calling it here is safe because we print it immediately and the executor
45-
# can complete the task before the context manager exits.
43+
44+
4645
.. method:: map(fn, *iterables, timeout=None, chunksize=1, buffersize=None)
4746

4847
Similar to :func:`map(fn, *iterables) <map>` except:
@@ -153,7 +152,7 @@ And::
153152
print(f.result())
154153

155154
executor = ThreadPoolExecutor(max_workers=1)
156-
executor.submit(wait_on_future).result()
155+
executor.submit(wait_on_future)
157156
# Note: calling future.result() here would cause a deadlock because the single
158157
# worker thread is already executing wait_on_future(), which itself is waiting
159158
# for a result from the same executor.

0 commit comments

Comments
 (0)