-
-
Notifications
You must be signed in to change notification settings - Fork 32k
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 our terms of service and privacy 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?
Conversation
cc @picnixz |
@@ -287,7 +292,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='', initializer=None, initargs=(), shared=None) | |||
.. class:: InterpreterPoolExecutor(max_workers=None, thread_name_prefix='', \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if the parameters are meant to be public but the signature indeed needs to be correct for possible subclassing.
However, prepare_context
is not documented so we can't even know how to use them. So we need to also document this at the same time.
And maybe I'm missing something but this is what the class method cpython/Lib/concurrent/futures/thread.py Lines 157 to 187 in 5ab66a8
|
in this case, we should wait for Eric's feedback. I'm away until Saturday so I won't be able to reply in the meantime. |
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 comment
The reason will be displayed to describe this comment to others. Learn more.
Setting up the necessary context for creating worker instances in a pool-based executor (e.g., in a concurrent environment like threads or interpreters). | |
Setting up the necessary context for creating worker instances in a pool-based executor (for example, in a concurrent environment like threads or interpreters). |
Use simple language and this line needs wrapping
based: #129669 (comment)
needs backport only to
3.14
📚 Documentation preview 📚: https://cpython-previews--134321.org.readthedocs.build/en/134321/library/concurrent.futures.html