Skip to content

Commit 837ead9

Browse files
committed
gh-124694: Document missing ctxkwargs argument in ThreadPoolExecutor
1 parent e007e62 commit 837ead9

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

Doc/library/concurrent.futures.rst

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ Executor Objects
7171
:class:`ThreadPoolExecutor` and :class:`InterpreterPoolExecutor`,
7272
*chunksize* has no effect.
7373

74-
.. versionchanged:: 3.5
74+
.. versionadded:: 3.5
7575
Added the *chunksize* parameter.
7676

77-
.. versionchanged:: 3.14
77+
.. versionadded:: 3.14
7878
Added the *buffersize* parameter.
7979

8080
.. method:: shutdown(wait=True, *, cancel_futures=False)
@@ -113,7 +113,7 @@ Executor Objects
113113
e.submit(shutil.copy, 'src3.txt', 'dest3.txt')
114114
e.submit(shutil.copy, 'src4.txt', 'dest4.txt')
115115

116-
.. versionchanged:: 3.9
116+
.. versionadded:: 3.9
117117
Added *cancel_futures*.
118118

119119

@@ -154,7 +154,8 @@ And::
154154
executor.submit(wait_on_future)
155155

156156

157-
.. class:: ThreadPoolExecutor(max_workers=None, thread_name_prefix='', initializer=None, initargs=())
157+
.. class:: ThreadPoolExecutor(max_workers=None, thread_name_prefix='', \
158+
initializer=None, initargs=(), **ctxkwargs)
158159
159160
An :class:`Executor` subclass that uses a pool of at most *max_workers*
160161
threads to execute calls asynchronously.
@@ -180,12 +181,12 @@ And::
180181
should be higher than the number of workers
181182
for :class:`ProcessPoolExecutor`.
182183

183-
.. versionchanged:: 3.6
184+
.. versionadded:: 3.6
184185
Added the *thread_name_prefix* parameter to allow users to
185186
control the :class:`threading.Thread` names for worker threads created by
186187
the pool for easier debugging.
187188

188-
.. versionchanged:: 3.7
189+
.. versionadded:: 3.7
189190
Added the *initializer* and *initargs* arguments.
190191

191192
.. versionchanged:: 3.8
@@ -201,6 +202,10 @@ And::
201202
Default value of *max_workers* is changed to
202203
``min(32, (os.process_cpu_count() or 1) + 4)``.
203204

205+
.. versionadded:: 3.14
206+
Added *ctxkwargs* to pass additional arguments to ``cls.prepare_context``
207+
class method.
208+
204209

205210
.. _threadpoolexecutor-example:
206211

@@ -287,7 +292,8 @@ efficient alternative is to serialize with :mod:`pickle` and then send
287292
the bytes over a shared :mod:`socket <socket>` or
288293
:func:`pipe <os.pipe>`.
289294

290-
.. class:: InterpreterPoolExecutor(max_workers=None, thread_name_prefix='', initializer=None, initargs=(), shared=None)
295+
.. class:: InterpreterPoolExecutor(max_workers=None, thread_name_prefix='', \
296+
initializer=None, initargs=(), shared=None)
291297

292298
A :class:`ThreadPoolExecutor` subclass that executes calls asynchronously
293299
using a pool of at most *max_workers* threads. Each thread runs
@@ -357,7 +363,9 @@ that :class:`ProcessPoolExecutor` will not work in the interactive interpreter.
357363
Calling :class:`Executor` or :class:`Future` methods from a callable submitted
358364
to a :class:`ProcessPoolExecutor` will result in deadlock.
359365

360-
.. class:: ProcessPoolExecutor(max_workers=None, mp_context=None, initializer=None, initargs=(), max_tasks_per_child=None)
366+
.. class:: ProcessPoolExecutor(max_workers=None, mp_context=None, \
367+
initializer=None, initargs=(), \
368+
max_tasks_per_child=None)
361369

362370
An :class:`Executor` subclass that executes calls asynchronously using a pool
363371
of at most *max_workers* processes. If *max_workers* is ``None`` or not
@@ -394,13 +402,13 @@ to a :class:`ProcessPoolExecutor` will result in deadlock.
394402
was undefined but operations on the executor or its futures would often
395403
freeze or deadlock.
396404

397-
.. versionchanged:: 3.7
405+
.. versionadded:: 3.7
398406
The *mp_context* argument was added to allow users to control the
399407
start_method for worker processes created by the pool.
400408

401409
Added the *initializer* and *initargs* arguments.
402410

403-
.. versionchanged:: 3.11
411+
.. versionadded:: 3.11
404412
The *max_tasks_per_child* argument was added to allow users to
405413
control the lifetime of workers in the pool.
406414

0 commit comments

Comments
 (0)