-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
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
Hello @picnixz ,
do you want it like this or something else. Please confirm me so that i can work in that direction.
|
1f5da7c to
05213dd
Compare
|
Please @picnixz , give me final instruction to fix this documentation issue |
| @@ -0,0 +1,3 @@ | |||
| Document ``help`` and ``aliases`` parameters for | |||
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. Delete. This. File.
| @@ -0,0 +1,3 @@ | |||
| Document ``help`` and ``aliases`` parameters for | |||
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. Delete. This. File.
Next time, please be patient. I do not have enough time to review PRs especially when my feedback is not properly addressed. |
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
|
Thanks @picnixz , for your effort for correcting me, for the mistake i am making. And i am very sorry for being impatient. I will keep it in my mind. And i was just being confused as it is sort of new for me, but i never want to disrespect you. |
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.
Some final comments. Otherwise I think we can merge it.
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
|
@picnixz Added all the changes you have requested for. |
| the main parser. | ||
|
|
||
|
|
||
| .. method:: _SubParsersAction.add_parser(name, *, help=None, aliases=None, |
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.
| .. method:: _SubParsersAction.add_parser(name, *, help=None, aliases=None, | |
| .. method:: _SubParsersAction.add_parser(name, *, help=None, aliases=None,\ |
When the signature requires multi lines I think we need this additional break. But if the docs render well without it you do not need to add it.
| >>> parser = argparse.ArgumentParser(prog='chicken.py') | ||
| >>> subparsers = parser.add_subparsers() | ||
| >>> fly = subparsers.add_parser('fly', deprecated=True) | ||
| >>> args = parser.parse_args(['fly']) # doctest: +SKIP |
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.
Can you remove the doctest skip? and write down the exact output so that we also catch message regressions just in case? ty
|
(Btw the major changes I requested are addressed so this is in a mergeable state should I say). |

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/