-
-
Notifications
You must be signed in to change notification settings - Fork 31.3k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add example for argparse
's append
action
#131389
base: main
Are you sure you want to change the base?
Conversation
Add an example for `argparse`'s `append` action when a default value is provided.
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.
Do we really need it? Maybe both could be combined? The provided explanation is clear to me:
If the default value is non-empty, the default elements will be present
in the parsed value for the option, with any values from the
command line appended after those default values.
The issue that drove this PR is that until I tested it, it was unclear that the
|
I see, you are correct, that should be clarified, but not as an example in my opinion as it is not very clear, and the text remains not clear. |
Unfortunately, there are several other parts of the argparse documentation which I think could be much clearer. Would it be valuable to make a separate PR for those? |
Hey, thanks for the PR. I recommend adding a note in the describing paragraph that this should be a list instead. The code example is a bit duplicative as is. If you have other ideas for documentation improvements, you're welcome to open issues so we can discuss the changes/areas where you think things could be clearer! |
Add an example for
argparse
'sappend
action when a default value is provided.📚 Documentation preview 📚: https://cpython-previews--131389.org.readthedocs.build/