Skip to content

Commit 63c57c8

Browse files
committed
Mention the "context manager" keyword in concurrent.futures documentation
I was searching for context manager-related part part of this documentation and I couldn't find anything because the words "context manager" weren't actually used anywhere. I think this will help with discoverability of this feature.
1 parent 72e5b25 commit 63c57c8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Doc/library/concurrent.futures.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,10 @@ Executor Objects
9494
executor has started running will be completed prior to this method
9595
returning. The remaining futures are cancelled.
9696

97-
You can avoid having to call this method explicitly if you use the
98-
:keyword:`with` statement, which will shutdown the :class:`Executor`
99-
(waiting as if :meth:`Executor.shutdown` were called with *wait* set to
100-
``True``)::
97+
You can avoid having to call this method explicitly if you use the executor
98+
as a :term:`context manager` via the :keyword:`with` statement,
99+
which will shutdown the :class:`Executor` (waiting as if
100+
:meth:`Executor.shutdown` were called with *wait* set to ``True``)::
101101

102102
import shutil
103103
with ThreadPoolExecutor(max_workers=4) as e:

0 commit comments

Comments
 (0)