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

gh-95065, gh-107704: Argument Clinic: support multiple '/ [from ...]' and '* [from ...]' markers #108132

Merged

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Aug 19, 2023

It does not even make the code much more complex. Simply the code which checks that the version is the same is replaced with the code which supports multiple versions.

$ git diff main... --stat Tools/clinic/clinic.py
 Tools/clinic/clinic.py | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------------
 1 file changed, 55 insertions(+), 50 deletions(-)

@erlend-aasland
Copy link
Contributor

It does not even make the code much more complex. Simply the code which checks that the version is the same is replaced with the code which supports multiple versions.

Indeed, the refactors from your previous PR came in handy here.

@erlend-aasland
Copy link
Contributor

Thanks, this is nice; @AlexWaygood, are you fine with this feature?

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

This looks pretty good to me! I'm impressed how little extra code it takes. I have one readability style nit.

I think we should maybe also add one or two examples to https://docs.python.org/3.13/howto/clinic.html#how-to-deprecate-passing-parameters-positionally-or-by-keyword that have mutliple / [from ...] and * [from ...] markers

@serhiy-storchaka serhiy-storchaka enabled auto-merge (squash) August 21, 2023 13:41
@serhiy-storchaka serhiy-storchaka merged commit 60942cc into python:main Aug 21, 2023
@serhiy-storchaka serhiy-storchaka deleted the clinic-deprecated-multi branch August 21, 2023 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants