GeezerVison is showing github.com — gh-113317: Pass clinic to AC parse_arg() methods by vstinner · Pull Request #114319 · python/cpython
Conversation
vstinner
commented
Jan 19, 2024
•
edited by bedevere-app
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Add 'clinic' parameter to Argument Clinic parse_arg() and bad_argument() methods. Remove usage of the 'clinic' global variable in these methods.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Add 'clinic' parameter to Argument Clinic parse_arg() and
bad_argument() methods. Remove usage of the 'clinic' global variable
in these methods.
|
Currently, it is possible to get limited_capi from clinic.limited_capi. But I'm not sure how the code is going to be refactored later, so I prefer to keep the two parameters for now: limited_capi and clinic.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Sorry, I disagree with this approach 🙂 It would be better to teach CConverter.add_include to handle multiple includes per converter, and then in output_templates() fetch all includes from all the converters and add them via clinic.add_include(). If we teach CConverter.add_include that trick, we won't need clinic in bad_argument. Also, that will result in a much smaller diff! What do you think?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
It would be better to teach CConverter.add_include to handle multiple includes per converter, and then in output_templates() fetch all includes from all the converters and add them via clinic.add_include().
Hum, that's strange: I already wrote an add_include() method in CConverter. In fact, bad_argument() can just reuse it.
I wrote PR #114324 which is way shorter.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
I wrote PR #114324 which is way shorter.
Let's focus on this approach instead. I close this PR.
|
erlend-aasland reacted with rocket emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
erlend-aasland
Awaiting requested review from erlend-aasland
erlend-aasland is a code owner
gpshead
Awaiting requested review from gpshead
gpshead is a code owner
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|