-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
Clarify the docs for args in asyncio callbacks
#143873
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
| *callback*. | ||
|
|
||
| Use :func:`functools.partial` :ref:`to pass keyword arguments | ||
| You can use :func:`functools.partial` :ref:`to pass *keyword* arguments |
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.
Please avoid such rewordings, and italics should be used for parameter names.
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 think the rewording makes it clearer (and kinder, in a sense). (What's the particular "such" here, though, so I know to avoid, well, such things in the future?)
My point for the italics was to emphasize for the reader that this is for keyword arguments, and the *args mechanism is already there for posargs.
| Raise :exc:`RuntimeError` if there is a problem setting up the handler. | ||
|
|
||
| Use :func:`functools.partial` :ref:`to pass keyword arguments | ||
| You can use :func:`functools.partial` :ref:`to pass *keyword* arguments |
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.
Ditto here.
| This method returns a :class:`asyncio.Future` object. | ||
|
|
||
| Use :func:`functools.partial` :ref:`to pass keyword arguments | ||
| You can use :func:`functools.partial` :ref:`to pass *keyword* arguments |
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.
And here.
While working on asyncio-related things, my eyes somehow skipped over the "keyword arguments" part of the sentence about
functools.partial, andargswasn't at all documented foradd_signal_handler.Hence, this PR gently clarifies the documentation for
*argsin asyncio loop callbacks and unifies all of the places referring tofunctools.partialto have similar verbiage.I think this is a trivial enough documentation improvement that it doesn't require an issue, but let me know if not so.
📚 Documentation preview 📚: https://cpython-previews--143873.org.readthedocs.build/