-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
gh-84116: Docs: Document help and aliases for argparse.add_parser() #140574
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
base: main
Are you sure you want to change the base?
Conversation
…python into doc-fix-140281
57a35b9 to
343648b
Compare
StanFromIreland
left a comment
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.
There seem to be two different things mixed in this PR, please split it.
ce36e2d to
10dffc6
Compare
|
Hi @savannahostrowski ,@picnixz I have made the requested changes; please review again. |
|
Thanks for making the requested changes! @savannahostrowski, @picnixz: please review the changes made to this pull request. |
|
Hi @savannahostrowski , @picnixz i have done all the changes according to your message been waiting for any further changes. |
|
Apologies for the confusion |
picnixz
left a comment
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.
There are still unrelated changes. Please avoid asking for a review if there is still things to change and address.
Doc/library/argparse.rst
Outdated
| *aliases* argument, | ||
| which allows multiple strings to refer to the same subparser. This example, | ||
| like ``svn``, aliases ``co`` as a shorthand for ``checkout``:: | ||
| .. method:: _SubParsersAction.add_parser(name, *, help=None, aliases=None, deprecated=False, **kwargs) |
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.
Why do we have a duplicated entry here?
|
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 |
Co-authored-by: Bénédikt Tran <[email protected]>
Co-authored-by: Bénédikt Tran <[email protected]>
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.
Please be more careful when you move text. You must keep all indications about "versionadded" etc, for each parameter so that users know when a feature was added. In addition, we are now missing the documentation for the general ArgumentParser.add_subparsers. Are you using an LLM for those changes? If so, please stop because this is wasting reviewer's time as there are useless and wrong changes.
In addition, please resolve the conflicts.
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.
Please add back this documentation! We only want to document _SubParserAction.add_parser but we don't want to change other documentation.
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 have added the changes only having _SubParserAction.add_parser.
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.
According to the diff, no. I don't see where the required parameter is documented. Please first fix the conflicts.
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.
For instance where is this line? it's not here anymore.
|
Before continuing working on this PR, please fix the conflicts. |
|
Hi @picnixz , |
| Description of parameters: | ||
| .. method:: _SubParsersAction.add_parser(name, *, help=None, aliases=None, deprecated=False, **kwargs) | ||
|
|
||
| * *title* - title for the sub-parser group in help output; by default |
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.
The section "descriptions of parameters" is tied to ArgumentParser.add_subparsers. Yoiu are documenting _SubParsersAction.add_parser which is different. In other words, don't change the "Description of parameters" section.
Co-authored-by: Stan Ulbrych <[email protected]>

gh-84116: Doc: update the argparse documentation to clearly define the help and aliases parameters for add_parser() and added the required news file for this change.
Doc/library/argparse.rst
Replaced the vague, single-sentence description of _SubParsersAction.add_parser with a formal .. method:: directive.
This new directive explicitly lists help and aliases as parameters, along with descriptions of what they do.
Removed the old, redundant paragraphs about help (which was in parentheses) and aliases (which was a "Furthermore..." note) from later in the document. This centralizes all the information in one logical place.
Misc/NEWS.d/next/Library/...
Added the required "blurb" file to log this documentation fix.
📚 Documentation preview 📚: https://cpython-previews--140574.org.readthedocs.build/