-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
gh-95065: Add Argument Clinic support for deprecating positional use of parameters #95151
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
Conversation
Disclaimer: there's probably a lot of corner cases I haven't thought of yet. This is very much a draft. |
@zware, are you interested in reviewing this? This is probably quite crude, but my Argument Clinic knowledge is minimal, so I think getting a round of reviews is needed for me to move forward with this. |
cc. @arhadthedev, if you would like to review this. |
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.
if you would like to review this
I have neither objections nor extra ideas here. Also, I fully agree that [...] we should create separate issues for each feature
later, not here and now.
The feature is not ready yet; dismissing premature approval.
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.
LGTM, besides few nitpicks.
Thank you all so much for helping out with this PR. I learned some new tricks, and it was very good with some extra pairs of eyes on this. |
I improved the NEWS entry, but I also think we should promote this feature in What's New. I'm not sure where in What's New, though. |
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.
No, I do not think that it should be in What's New. Argument Clinic is an implementation detail. Everything made with Argument Clinic can be made without Argument Clinic. Only the end result is important for users.
Misc/NEWS.d/next/Tools-Demos/2022-07-23-00-33-28.gh-issue-95065.NfCCpp.rst
Outdated
Show resolved
Hide resolved
…5.NfCCpp.rst Co-authored-by: Serhiy Storchaka <[email protected]>
Thanks again. I'll wait for Alex's approval before landing. |
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.
The grammar in one of the deprecation messages in the tests is still not ideal — here's a way to fix 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.
LGTM
This reverts commit d2130ab, but keeps the test.
…of parameters (python/cpython#95151) It is now possible to deprecate passing parameters positionally with Argument Clinic, using the new '* [from X.Y]' syntax. (To be read as "keyword-only from Python version X.Y") Co-authored-by: Alex Waygood <[email protected]> Co-authored-by: Serhiy Storchaka <[email protected]>
…itional use of parameters (python/cpython#95151) It is now possible to deprecate passing parameters positionally with Argument Clinic, using the new '* [from X.Y]' syntax. (To be read as "keyword-only from Python version X.Y") Co-authored-by: Alex Waygood <[email protected]> Co-authored-by: Serhiy Storchaka <[email protected]>
…itional use of parameters (python/cpython#95151) It is now possible to deprecate passing parameters positionally with Argument Clinic, using the new '* [from X.Y]' syntax. (To be read as "keyword-only from Python version X.Y") Co-authored-by: Alex Waygood <[email protected]> Co-authored-by: Serhiy Storchaka <[email protected]>
Add support for deprecating positional use of optional parameters by
introducing the
* [from X.Y]
syntax, meaning the following parameterswill be keyword-only starting with Python version X.Y. Code that emits
DeprecationWarnings and compile time messages will be automatically
generated.
Multiple
* [from X.Y]
lines are not allowed (yet).