Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
hansthen wants to merge6 commits intopython:main
base:main
Choose a base branch
Loading
fromhansthen:issue-132558-improve-documentation

Conversation

hansthen
Copy link

@hansthenhansthen commentedMay 10, 2025
edited by github-actionsbot
Loading

This clarifies the documentation a bit to warn users of the potential side effects of using bothtype andchoices on an action. It also suggests that it is better in those cases to do type conversion in application code.


📚 Documentation preview 📚:https://cpython-previews--133827.org.readthedocs.build/

@bedevere-appbedevere-appbot added docsDocumentation in the Doc dir skip news labelsMay 10, 2025
@picnixzpicnixz changed the titlegh-132558: Improve docs on combining *type* and *choices*gh-132558: Improveargparse docs on combiningtype andchoicesMay 10, 2025
Comment on lines 1130 to 1133
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_.

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.

Copy link
Author

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?

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.

Comment on lines 1141 to 1142
Use of :class:`enum.Enum` is not recommended because it is difficult to
control its appearance in these messages.

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.

Copy link
Member

@savannahostrowskisavannahostrowski left a 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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
your application code.
your application code.

@bedevere-app
Copy link

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 phraseI have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

And if you don't make the requested changes, you will be put in the comfy chair!

@savannahostrowskisavannahostrowski added needs backport to 3.13bugs and security fixes needs backport to 3.14bugs and security fixes labelsJul 8, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@StanFromIrelandStanFromIrelandStanFromIreland left review comments

@savannahostrowskisavannahostrowskisavannahostrowski requested changes

Assignees
No one assigned
Labels
awaiting changesdocsDocumentation in the Doc dirneeds backport to 3.13bugs and security fixesneeds backport to 3.14bugs and security fixesskip news
Projects
Status: Todo
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@hansthen@savannahostrowski@StanFromIreland

[8]ページ先頭

©2009-2025 Movatter.jp