GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-113317: Pass clinic to AC parse_arg() methods by vstinner · Pull Request #114319 · python/cpython

Conversation

@vstinner

@vstinner vstinner commented Jan 19, 2024 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Add 'clinic' parameter to Argument Clinic parse_arg() and bad_argument() methods. Remove usage of the 'clinic' global variable in these methods.

  • Issue: Argument Clinic: split out global stateless helpers and constants from clinic.py #113317

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@vstinner
pythongh-113317: Pass clinic to AC parse_arg() methods
befdc3f
Add 'clinic' parameter to Argument Clinic parse_arg() and
bad_argument() methods. Remove usage of the 'clinic' global variable
in these methods.
@vstinner vstinner added the skip news label Jan 19, 2024
@vstinner
vstinner requested review from a team, AlexWaygood, erlend-aasland and gpshead as code owners January 19, 2024 15:43
@bedevere-app bedevere-app Bot added the awaiting core review label Jan 19, 2024
@bedevere-app bedevere-app Bot mentioned this pull request Jan 19, 2024
Argument Clinic: split out global stateless helpers and constants from clinic.py #113317
Closed
@vstinner

vstinner commented Jan 19, 2024

Copy link
Copy Markdown
Member Author

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@erlend-aasland

erlend-aasland commented Jan 19, 2024

Copy link
Copy Markdown
Contributor

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?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner

vstinner commented Jan 19, 2024

Copy link
Copy Markdown
Member Author

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner

vstinner commented Jan 19, 2024

Copy link
Copy Markdown
Member Author

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
All reactions
  • 🚀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner vstinner closed this Jan 19, 2024
@vstinner
vstinner deleted the ac_pass_clinic branch January 19, 2024 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@erlend-aasland erlend-aasland Awaiting requested review from erlend-aasland erlend-aasland is a code owner
@AlexWaygood AlexWaygood Awaiting requested review from AlexWaygood
@gpshead 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

Labels

awaiting core review skip news

Projects

None yet

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.

2 participants

@vstinner @erlend-aasland
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.