Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.1k
GH-99749: Add optional feature to suggest correct names (ArgumentParser)#124456
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
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.
A fix should definitely precede a new feature. |
Uh oh!
There was an error while loading.Please reload this page.
Misc/NEWS.d/next/Library/2024-09-24-18-49-16.gh-issue-99749.gBDJX7.rst OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
…DJX7.rstCo-authored-by: Serhiy Storchaka <storchaka@gmail.com>
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.
624be86
intopython:mainUh oh!
There was an error while loading.Please reload this page.
These are- `suggest_on_error`, added bypython/cpython#124456, made keyword-only bypython/cpython#133302- `color`, added bypython/cpython#132323
…13947)These are- `suggest_on_error`, added bypython/cpython#124456, made keyword-only bypython/cpython#133302- `color`, added bypython/cpython#132323Co-authored-by: Sebastian Rittau <srittau@rittau.biz>Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
…ython#13947)These are- `suggest_on_error`, added bypython/cpython#124456, made keyword-only bypython/cpython#133302- `color`, added bypython/cpython#132323Co-authored-by: Sebastian Rittau <srittau@rittau.biz>Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
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 thesuggest_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.
choices
argument #99749📚 Documentation preview 📚:https://cpython-previews--124456.org.readthedocs.build/