Skip to content
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

Document how to use varargs in Argument Clinic #1277

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

aisk
Copy link

@aisk aisk commented Feb 23, 2024

This is related to python/cpython#64490


📚 Documentation preview 📚: https://cpython-devguide--1277.org.readthedocs.build/

Copy link
Member

@ezio-melotti ezio-melotti left a comment

Choose a reason for hiding this comment

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

This might be higher up in the list.
Should **kwargs be documented too, possibly together with *args?

@aisk
Copy link
Author

aisk commented Feb 25, 2024

Thanks for the review!

This might be higher up in the list.

Is it ok to move it below How to convert METH_O and METH_NOARGS functions?

Should **kwargs be documented too, possibly together with *args?

According to python/cpython#64490, **kwargs is not supported by Argument Clinic.

@aisk aisk requested a review from ezio-melotti April 21, 2024 15:47
@willingc
Copy link
Collaborator

@ezio-melotti You have more experience with this tool than I do. Is this PR ready for merge?

@ezio-melotti
Copy link
Member

LGTM. @erlend-aasland?


To convert a var-positional parameter function,
prepending the parameter name with ``*`` ,
and the parameter should use the ``object`` converter::
Copy link
Member

Choose a reason for hiding this comment

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

What happens if I use something else? E.g., what if I want to accept an arbitrary number of ints?

Also, what type does the implementation function receive?

Copy link
Author

Choose a reason for hiding this comment

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

Thank you for the review! I have added a new paragraph to explain more about it.

development-tools/clinic.rst Outdated Show resolved Hide resolved
development-tools/clinic.rst Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants