Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
gh-124694: Document missing ctxkwargs argument in ThreadPoolExecutor#134321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -114,7 +114,7 @@ Executor Objects | ||||||
e.submit(shutil.copy, 'src4.txt', 'dest4.txt') | ||||||
.. versionchanged:: 3.9 | ||||||
Addedthe*cancel_futures* parameter. | ||||||
ThreadPoolExecutor | ||||||
@@ -154,7 +154,8 @@ And:: | ||||||
executor.submit(wait_on_future) | ||||||
.. class:: ThreadPoolExecutor(max_workers=None, thread_name_prefix='', \ | ||||||
initializer=None, initargs=(), **ctxkwargs) | ||||||
An :class:`Executor` subclass that uses a pool of at most *max_workers* | ||||||
threads to execute calls asynchronously. | ||||||
@@ -201,6 +202,15 @@ And:: | ||||||
Default value of *max_workers* is changed to | ||||||
``min(32, (os.process_cpu_count() or 1) + 4)``. | ||||||
.. versionchanged:: 3.14 | ||||||
Added *ctxkwargs* to pass additional arguments to ``cls.prepare_context`` | ||||||
class method. | ||||||
.. classmethod:: prepare_context(initializer, initargs) | ||||||
Setting up the necessary context for creating worker instances in a pool-based executor (e.g., in a concurrent environment like threads or interpreters). | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Suggested change
Use simple language and this line needs wrapping | ||||||
.. versionadded:: 3.14 | ||||||
.. _threadpoolexecutor-example: | ||||||
@@ -287,7 +297,8 @@ efficient alternative is to serialize with :mod:`pickle` and then send | ||||||
the bytes over a shared :mod:`socket <socket>` or | ||||||
:func:`pipe <os.pipe>`. | ||||||
.. class:: InterpreterPoolExecutor(max_workers=None, thread_name_prefix='', \ | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. This is unrelated, but it's probably an improvement as it's now more readable. So I'm ok with it. | ||||||
initializer=None, initargs=(), shared=None) | ||||||
A :class:`ThreadPoolExecutor` subclass that executes calls asynchronously | ||||||
using a pool of at most *max_workers* threads. Each thread runs | ||||||
@@ -357,7 +368,9 @@ that :class:`ProcessPoolExecutor` will not work in the interactive interpreter. | ||||||
Calling :class:`Executor` or :class:`Future` methods from a callable submitted | ||||||
to a :class:`ProcessPoolExecutor` will result in deadlock. | ||||||
.. class:: ProcessPoolExecutor(max_workers=None, mp_context=None, \ | ||||||
initializer=None, initargs=(), \ | ||||||
max_tasks_per_child=None) | ||||||
An :class:`Executor` subclass that executes calls asynchronously using a pool | ||||||
of at most *max_workers* processes. If *max_workers* is ``None`` or not | ||||||
Uh oh!
There was an error while loading.Please reload this page.