gh-84116: Docs: Document help and aliases for argparse.add_parser()#140574
gh-84116: Docs: Document help and aliases for argparse.add_parser()#140574savannahostrowski merged 64 commits intopython:mainfrom
Conversation
…python into doc-fix-140281
57a35b9 to
343648b
Compare
StanFromIreland
left a comment
There was a problem hiding this comment.
There seem to be two different things mixed in this PR, please split it.
ce36e2d to
10dffc6
Compare
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.
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. |
Doc/library/argparse.rst
Outdated
| >>> 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.
Can you remove the doctest skip? and write down the exact output so that we also catch message regressions just in case? ty
There was a problem hiding this comment.
Hi @picnixz , Even after removing the # doctest: +SKIP the document does not produce the warning. so if you want i can remove the warning line below.
There was a problem hiding this comment.
If the warning line is not emitted that is a bit weird. Is the warning emitted with the REPL?
There was a problem hiding this comment.
@picnixz i am able to produce the warning now
the warning goes by
chicken.py: warning: command 'fly' is deprecated
Namespace()
so i will be adding exactly the same or not.
There was a problem hiding this comment.
This has still not be changed. I want you to remove the skip and match the message correctly..
There was a problem hiding this comment.
I was just updating my branch here i have added the changes you requested.
|
(Btw the major changes I requested are addressed so this is in a mergeable state should I say). |
|
Hello @savannahostrowski the previous issue of two commit is being merged due to some issue in the branch and the documentation of free threading is merged in pr #140566. So if you please review the whole commit of this pr and tell me what else you need I can work according to it. |
|
Hello @StanFromIreland The commits are already splited. please check out the changes done and tell me what else you need to be changed in the documentation |
|
Oops, I forgot to officially hit the approve button after reviewing this/before merging, that's my bad. I think we should close this one out and tackle any minor follow ups etc. in other PRs since this has been ongoing for quite awhile. Thanks a lot for all the back and forth here @picnixz! Much appreciated. |
|
Tip for next time, let's try and avoid listing all the cleanup commits in the squashed message, but keep the Co-authored-by trailers at the end: (I use Refined GitHub which usually clears all that out.) Thanks! |
|
Ah yeah, I forgot to do that too. I typically remember but I guess I'm just off my game today. Sorry! |
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/