Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.4k
gh-132558: Improveargparse
docs on combiningtype
andchoices
#133827
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
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
argparse
docs on combiningtype
andchoices
Doc/library/argparse.rst Outdated
Formatted choices override the default *metavar* which is normally derived | ||
from *dest*. This is usually what you want because the user never sees the | ||
*dest* parameter. If this display isn't desirable (perhaps because there are | ||
many choices), just specify an explicit metavar_. |
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.
This should not be inbetween the choices notes.
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.
It was already with thechoices
documentation. Where would you move it to?
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.
You should move the text you added above it.
Doc/library/argparse.rst Outdated
Use of :class:`enum.Enum` is not recommended because it is difficult to | ||
control its appearance in these messages. |
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.
I think it's previous place was fine, it continued naturally from the previous point.
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Savannah Bailey <savannahostrowski@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.
Just adding a new line back but otherwise, I think this looks good to go.
To keep *choices* user-friendly, consider a custom type wrapper that | ||
converts and formats values, or omit type_ and handle conversion in | ||
your application code. |
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.
your application code. | |
your application code. | |
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase And if you don't make the requested changes, you will be put in the comfy chair! |
Uh oh!
There was an error while loading.Please reload this page.
This clarifies the documentation a bit to warn users of the potential side effects of using both
type
andchoices
on an action. It also suggests that it is better in those cases to do type conversion in application code.choices
withtype
#132558📚 Documentation preview 📚:https://cpython-previews--133827.org.readthedocs.build/