GeezerVison is showing github.com — GH-99749: Add optional feature to suggest correct names (ArgumentParser) by savannahostrowski · Pull Request #124456 · python/cpython
Conversation
savannahostrowski
commented
Sep 24, 2024
•
edited by github-actions
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
This PR carries #99773 forward with the original author's go-ahead (thanks @abdulrafey38!). This adds the ability for ArgumentParser to offer suggestions for mistyped argument choices or subparser names. This PR adds this as an optional feature via the suggest_on_error param (default: False).
I have opted to not make this configurable at the subparser or argument level and instead at the parser level to keep this simple. We could consider additional granularity but I'm not convinced that this is required at this time.
📚 Documentation preview 📚: https://cpython-previews--124456.org.readthedocs.build/
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
danielhollas reacted with eyes emoji
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 PR slightly conflicts with #117766. After merging one of them, the other one should be updated. I am not sure what of them should be merged first.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This PR slightly conflicts with #117766. After merging one of them, the other one should be updated. I am not sure what of them should be merged first.
A fix should definitely precede a new feature.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Labels
3.14
bugs and security fixes
stdlib
Standard Library Python modules in the Lib/ directory
type-feature
A feature request or enhancement
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.
|