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: Don't use global clinic instance in bad_argument() by erlend-aasland · Pull Request #114330 · python/cpython

Conversation

@erlend-aasland

@erlend-aasland erlend-aasland commented Jan 19, 2024 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Make it possible for a converter to have multiple includes.
Also make the 'includes' an instance attribute. This implies
some converter includes are added to the converters during
template generation (parse_arg()), so we have to query the
converters about their includes at the end of the template
generation.

  • 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
@erlend-aasland
pythongh-113317: Don't use global clinic instance in bad_argument()
51d79ea
Make it possible for a converter to have multiple includes, make the
'includes' an instance attribute. This implies converter includes are
added during template generation, so we have to add them to the clinic
instance at the end of the template generation instead of in the
beginning.
@erlend-aasland
erlend-aasland requested a review from AlexWaygood as a code owner January 19, 2024 20:32
@erlend-aasland erlend-aasland added the skip news label Jan 19, 2024
@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
@erlend-aasland

erlend-aasland commented Jan 19, 2024

Copy link
Copy Markdown
Contributor Author

Competing PR to #114324 😎⚔️

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 Author

Post this, the global clinic instance is only used by warn/fail. Poke, poke https://github.com/Argument-Clinic/cpython/pull/35.

All reactions

Sorry, something went wrong.

Uh oh!

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

@erlend-aasland
erlend-aasland requested a review from vstinner January 20, 2024 07:31
vstinner
vstinner reviewed Jan 21, 2024
View reviewed changes
Comment thread Tools/clinic/clinic.py Resolved

Uh oh!

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

vstinner
vstinner approved these changes Jan 22, 2024
View reviewed changes

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

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.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Tools/clinic/clinic.py Resolved

Uh oh!

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

@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Jan 22, 2024
@erlend-aasland
Address review
1118637
@erlend-aasland

erlend-aasland commented Jan 22, 2024

Copy link
Copy Markdown
Contributor Author

Thanks for the review, Victor. I'll wait a bit for Alex to chime in before landing.

All reactions

Sorry, something went wrong.

Uh oh!

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

@erlend-aasland

erlend-aasland commented Jan 23, 2024

Copy link
Copy Markdown
Contributor Author

I'm going to land this tomorrow.

All reactions

Sorry, something went wrong.

Uh oh!

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

AlexWaygood
AlexWaygood approved these changes Jan 23, 2024
View reviewed changes

@AlexWaygood AlexWaygood left a comment

Copy link
Copy Markdown
Member

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.

Nice, thanks! Sorry for the delay!

Sorry, something went wrong.

Uh oh!

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

erlend-aasland reacted with heart emoji
All reactions
  • ❤️ 1 reaction
@erlend-aasland
erlend-aasland merged commit e14930f into python:main Jan 23, 2024
@erlend-aasland
erlend-aasland deleted the clinic/converter-includes branch January 23, 2024 10:07
@bedevere-app bedevere-app Bot removed the awaiting merge label Jan 23, 2024
@erlend-aasland

erlend-aasland commented Jan 23, 2024

Copy link
Copy Markdown
Contributor Author

Thanks, both!

AlexWaygood reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

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

@vstinner

vstinner commented Jan 23, 2024

Copy link
Copy Markdown
Member

One less usage of globals!

AlexWaygood reacted with hooray emoji erlend-aasland reacted with rocket emoji
All reactions
  • 🎉 1 reaction
  • 🚀 1 reaction

Sorry, something went wrong.

Uh oh!

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

aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
@erlend-aasland @aisk
pythongh-113317: Don't use global clinic instance in bad_argument() (p…
c082ff6
…ython#114330)

Make it possible for a converter to have multiple includes, by collecting
them in a list on the converter instance. This implies converter includes
are added during template generation, so we have to add them to the
clinic instance at the end of the template generation instead of in the
beginning.
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
@erlend-aasland @Glyphack
pythongh-113317: Don't use global clinic instance in bad_argument() (p…
603e4e5
…ython#114330)

Make it possible for a converter to have multiple includes, by collecting
them in a list on the converter instance. This implies converter includes
are added during template generation, so we have to add them to the
clinic instance at the end of the template generation instead of in the
beginning.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@vstinner vstinner vstinner approved these changes
@AlexWaygood AlexWaygood AlexWaygood approved these changes

Uh oh!

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

Assignees

No one assigned

Labels

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.

3 participants

@erlend-aasland @vstinner @AlexWaygood
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.