Skip to content

Conversation

@akx
Copy link
Contributor

@akx akx commented Jan 15, 2026

While working on asyncio-related things, my eyes somehow skipped over the "keyword arguments" part of the sentence about functools.partial, and args wasn't at all documented for add_signal_handler.

Hence, this PR gently clarifies the documentation for *args in asyncio loop callbacks and unifies all of the places referring to functools.partial to 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/

*callback*.

Use :func:`functools.partial` :ref:`to pass keyword arguments
You can use :func:`functools.partial` :ref:`to pass *keyword* arguments
Copy link
Member

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.

Copy link
Contributor Author

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
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants