GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-84116: Docs: Document help and aliases for argparse.add_parser() by Krishna-web-hub · Pull Request #140574 · python/cpython

Conversation

@Krishna-web-hub

@Krishna-web-hub Krishna-web-hub commented Oct 25, 2025 •
edited by github-actions Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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/

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Krishna-web-hub added 6 commits October 24, 2025 20:55
@Krishna-web-hub
pythongh-140281: Doc: Update free-threading how-to
810fde1
@Krishna-web-hub
pythongh-140281: Doc: Update free-threading how-to
b9ca059
@Krishna-web-hub
Merge branch 'main' into doc-fix-140281
bfbf864
@Krishna-web-hub
Fix trailing whitespace
16a1c46
@Krishna-web-hub
Merge branch 'doc-fix-140281' of https://github.com/Krishna-web-hub/c…
639865d
…python into doc-fix-140281
@Krishna-web-hub
doc fixing of the cpython fixes#84116
3f0aa48
@Krishna-web-hub
Krishna-web-hub requested a review from savannahostrowski as a code owner October 25, 2025 09:47
@bedevere-app bedevere-app Bot added the docs Documentation in the Doc dir label Oct 25, 2025
@github-project-automation github-project-automation Bot added this to Docs PRs Oct 25, 2025
@bedevere-app bedevere-app Bot mentioned this pull request Oct 25, 2025
argparse: help parameter not documented in add_subparsers().add_parser #84116
Closed
@bedevere-app bedevere-app Bot added the awaiting review label Oct 25, 2025
@github-project-automation github-project-automation Bot moved this to Todo in Docs PRs Oct 25, 2025
@Krishna-web-hub
Docs: Document help and aliases for argparse.add_parser() (pythongh-8…
343648b
…4116)
@Krishna-web-hub
Krishna-web-hub force-pushed the doc-fix-84116 branch from 57a35b9 to 343648b Compare October 25, 2025 10:16
@StanFromIreland StanFromIreland changed the title Doc fix 84116Docs: Document help and aliases for argparse.add_parser() (gh-84116) #84116 gh-84116: Docs: Document help and aliases for argparse.add_parser() Oct 25, 2025
@Krishna-web-hub
Docs: Document help and aliases for argparse.add_parser() (pythongh-8…
4b07ba3
…4116)
StanFromIreland
StanFromIreland requested changes Oct 25, 2025
View reviewed changes

@StanFromIreland StanFromIreland left a comment

Copy link
Copy Markdown
Member

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-app bedevere-app Bot added awaiting core review and removed awaiting review labels Oct 25, 2025
Krishna-web-hub added 9 commits October 25, 2025 16:16
@Krishna-web-hub
Fix trailing whitespace
8bb4bae
@Krishna-web-hub
Fix trailing whitespace
3361447
@Krishna-web-hub
Fix trailing whitespace
100207d
@Krishna-web-hub
Fix trailing whitespace
0f27e63
@Krishna-web-hub
Fix trailing whitespace
7e6102a
@Krishna-web-hub
Fix trailing whitespace
a76954c
@Krishna-web-hub
Fix trailing errors
ac2b754
@Krishna-web-hub
Fix trailing errors and spaces
b08e8ed
@Krishna-web-hub
Fix docutils formatting, NEWS ref, and trailing whitespace
fa1d877
@Krishna-web-hub
Krishna-web-hub force-pushed the doc-fix-84116 branch from ce36e2d to 10dffc6 Compare October 25, 2025 13:52
@Krishna-web-hub
Docs: Update argparse.rst and add NEWS entry
e955fb0
@Krishna-web-hub

Krishna-web-hub commented Jan 16, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Krishna-web-hub added 2 commits January 17, 2026 01:46
@Krishna-web-hub
Merge branch 'main' into doc-fix-84116
2e7f2b0
@Krishna-web-hub
Merge branch 'main' into doc-fix-84116
e3e5071
picnixz
picnixz reviewed Jan 18, 2026
View reviewed changes

@picnixz picnixz left a comment

Copy link
Copy Markdown
Member

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/library/argparse.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/argparse.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/argparse.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/argparse.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/argparse.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Krishna-web-hub and others added 5 commits January 18, 2026 11:41
@Krishna-web-hub @picnixz
Update Doc/library/argparse.rst
b6975a7
Co-authored-by: Bénédikt Tran <[email protected]>
@Krishna-web-hub @picnixz
changes python#1
04a0482
Co-authored-by: Bénédikt Tran <[email protected]>
@Krishna-web-hub @picnixz
Update Doc/library/argparse.rst 2
0d4fcb5
Co-authored-by: Bénédikt Tran <[email protected]>
@Krishna-web-hub @picnixz
removed useless thing
7d3982f
Co-authored-by: Bénédikt Tran <[email protected]>
@Krishna-web-hub @picnixz
changed according to the request
b2ff463
Co-authored-by: Bénédikt Tran <[email protected]>
@Krishna-web-hub

Krishna-web-hub commented Jan 18, 2026

Copy link
Copy Markdown
Contributor Author

@picnixz Added all the changes you have requested for.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Krishna-web-hub
Merge branch 'main' into doc-fix-84116
5709cc6
picnixz
picnixz reviewed Jan 19, 2026
View reviewed changes
Comment thread Doc/library/argparse.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread 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

@picnixz picnixz Jan 19, 2026

Copy link
Copy Markdown
Member

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@Krishna-web-hub Krishna-web-hub Feb 1, 2026

Copy link
Copy Markdown
Contributor Author

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.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@picnixz picnixz Feb 1, 2026

Copy link
Copy Markdown
Member

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.

If the warning line is not emitted that is a bit weird. Is the warning emitted with the REPL?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@Krishna-web-hub Krishna-web-hub Feb 1, 2026

Copy link
Copy Markdown
Contributor Author

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.

@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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

picnixz reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@picnixz picnixz Feb 3, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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.

This has still not be changed. I want you to remove the skip and match the message correctly..

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@Krishna-web-hub Krishna-web-hub Feb 3, 2026

Copy link
Copy Markdown
Contributor Author

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 was just updating my branch here i have added the changes you requested.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@picnixz picnixz added awaiting core review and removed awaiting changes labels Jan 19, 2026
@picnixz

picnixz commented Jan 19, 2026

Copy link
Copy Markdown
Member

(Btw the major changes I requested are addressed so this is in a mergeable state should I say).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@picnixz
picnixz dismissed their stale review February 1, 2026 17:55

Changes were addressed.

@Krishna-web-hub

Krishna-web-hub commented Feb 2, 2026

Copy link
Copy Markdown
Contributor Author

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Krishna-web-hub

Krishna-web-hub commented Feb 2, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Krishna-web-hub added 2 commits February 3, 2026 15:06
@Krishna-web-hub
Merge branch 'main' into doc-fix-84116
bc50109
@Krishna-web-hub
Updated the test part
c69d057
@savannahostrowski
savannahostrowski merged commit 74db440 into python:main Feb 6, 2026
29 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@github-project-automation github-project-automation Bot moved this from Todo to Done in Docs PRs Feb 6, 2026
@bedevere-app bedevere-app Bot removed the awaiting core review label Feb 6, 2026
@savannahostrowski

savannahostrowski commented Feb 6, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hugovk

hugovk commented Feb 6, 2026

Copy link
Copy Markdown
Member

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:

74db440

(I use Refined GitHub which usually clears all that out.)

Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@savannahostrowski

savannahostrowski commented Feb 6, 2026

Copy link
Copy Markdown
Member

Ah yeah, I forgot to do that too. I typically remember but I guess I'm just off my game today. Sorry!

hugovk reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

guoci
guoci reviewed Feb 7, 2026
View reviewed changes
Comment thread Doc/library/argparse.rst
the main parser.


.. method:: _SubParsersAction.add_parser(name, *, help=None, aliases=None,

@guoci guoci Feb 7, 2026

Copy link
Copy Markdown
Contributor

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.

Missing backslash, fixed at #144572.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Krishna-web-hub
Krishna-web-hub deleted the doc-fix-84116 branch February 7, 2026 19:04
thunder-coding pushed a commit to thunder-coding/cpython that referenced this pull request Feb 15, 2026
@Krishna-web-hub @picnixz
@StanFromIreland @thunder-coding
pythongh-84116: Docs: Document help and aliases for argparse.add_pars…
d095dc3
…er() (python#140574)

* pythongh-140281: Doc: Update free-threading how-to

* pythongh-140281: Doc: Update free-threading how-to

* Fix trailing whitespace

* doc fixing of the cpython fixes#84116

* Docs: Document help and aliases for argparse.add_parser() (pythongh-84116)

* Docs: Document help and aliases for argparse.add_parser() (pythongh-84116)

* Fix trailing whitespace

* Fix trailing whitespace

* Fix trailing whitespace

* Fix trailing whitespace

* Fix trailing whitespace

* Fix trailing whitespace

* Fix trailing errors

* Fix trailing errors and spaces

* Fix docutils formatting, NEWS ref, and trailing whitespace

* Docs: Update argparse.rst and add NEWS entry

* Delete Doc/howto/free-threading-python.rst

* Delete Misc/NEWS.d/next/Documentation/2025-10-25-00-49-43.gh-issue-140281.tuMQUe.rst

* adding the depreceated tag

* The error indexing was fixed

* Fix trailing whitespace

* Restore missing free-threading documentation

* fixing some minor error

* fixing some minor error part 2

* fixing some minor error part 3

* Fix NEWS entry format

* Final cleanup of NEWS entry format 2

* changes in the argparse.rst

* Remove unnecessary NEWS entry

* Fixing the issue as requested

* Added the Changes done before.

* done the changes

* done the changes#1

* Apply suggestion from @picnixz

Co-authored-by: Bénédikt Tran <[email protected]>

* Apply suggestion from @picnixz

Co-authored-by: Bénédikt Tran <[email protected]>

* Done the changes

* Done the new changes

* The versionadded is rectified

* Update Doc/library/argparse.rst

Co-authored-by: Stan Ulbrych <[email protected]>

* Docs editing

* Docs fixing whitespace

* Docs rectifiying

* little bit rectification

* Indentation rectification

* Indentation rectification 1

* Apply suggestion from @picnixz

Co-authored-by: Bénédikt Tran <[email protected]>

* deprecated rectification

* Remove mistakenly added NEWS entry

* Update Doc/library/argparse.rst

Co-authored-by: Bénédikt Tran <[email protected]>

* changes python#1

Co-authored-by: Bénédikt Tran <[email protected]>

* Update Doc/library/argparse.rst 2

Co-authored-by: Bénédikt Tran <[email protected]>

* removed useless thing

Co-authored-by: Bénédikt Tran <[email protected]>

* changed according to the request

Co-authored-by: Bénédikt Tran <[email protected]>

* Updated the test part

---------

Co-authored-by: Bénédikt Tran <[email protected]>
Co-authored-by: Stan Ulbrych <[email protected]>
ljfp pushed a commit to ljfp/cpython that referenced this pull request Apr 25, 2026
@Krishna-web-hub @picnixz
@StanFromIreland @ljfp
pythongh-84116: Docs: Document help and aliases for argparse.add_pars…
87f5018
…er() (python#140574)

* pythongh-140281: Doc: Update free-threading how-to

* pythongh-140281: Doc: Update free-threading how-to

* Fix trailing whitespace

* doc fixing of the cpython fixes#84116

* Docs: Document help and aliases for argparse.add_parser() (pythongh-84116)

* Docs: Document help and aliases for argparse.add_parser() (pythongh-84116)

* Fix trailing whitespace

* Fix trailing whitespace

* Fix trailing whitespace

* Fix trailing whitespace

* Fix trailing whitespace

* Fix trailing whitespace

* Fix trailing errors

* Fix trailing errors and spaces

* Fix docutils formatting, NEWS ref, and trailing whitespace

* Docs: Update argparse.rst and add NEWS entry

* Delete Doc/howto/free-threading-python.rst

* Delete Misc/NEWS.d/next/Documentation/2025-10-25-00-49-43.gh-issue-140281.tuMQUe.rst

* adding the depreceated tag

* The error indexing was fixed

* Fix trailing whitespace

* Restore missing free-threading documentation

* fixing some minor error

* fixing some minor error part 2

* fixing some minor error part 3

* Fix NEWS entry format

* Final cleanup of NEWS entry format 2

* changes in the argparse.rst

* Remove unnecessary NEWS entry

* Fixing the issue as requested

* Added the Changes done before.

* done the changes

* done the changes#1

* Apply suggestion from @picnixz

Co-authored-by: Bénédikt Tran <[email protected]>

* Apply suggestion from @picnixz

Co-authored-by: Bénédikt Tran <[email protected]>

* Done the changes

* Done the new changes

* The versionadded is rectified

* Update Doc/library/argparse.rst

Co-authored-by: Stan Ulbrych <[email protected]>

* Docs editing

* Docs fixing whitespace

* Docs rectifiying

* little bit rectification

* Indentation rectification

* Indentation rectification 1

* Apply suggestion from @picnixz

Co-authored-by: Bénédikt Tran <[email protected]>

* deprecated rectification

* Remove mistakenly added NEWS entry

* Update Doc/library/argparse.rst

Co-authored-by: Bénédikt Tran <[email protected]>

* changes python#1

Co-authored-by: Bénédikt Tran <[email protected]>

* Update Doc/library/argparse.rst 2

Co-authored-by: Bénédikt Tran <[email protected]>

* removed useless thing

Co-authored-by: Bénédikt Tran <[email protected]>

* changed according to the request

Co-authored-by: Bénédikt Tran <[email protected]>

* Updated the test part

---------

Co-authored-by: Bénédikt Tran <[email protected]>
Co-authored-by: Stan Ulbrych <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@picnixz picnixz picnixz left review comments
@StanFromIreland StanFromIreland Awaiting requested review from StanFromIreland
@savannahostrowski savannahostrowski Awaiting requested review from savannahostrowski savannahostrowski is a code owner
@dreadstache dreadstache Awaiting requested review from dreadstache
+1 more reviewer
@guoci guoci guoci left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

docs Documentation in the Doc dir skip news

Projects

Docs PRs
Status: Done

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

7 participants

@Krishna-web-hub @picnixz @savannahostrowski @hugovk @guoci @StanFromIreland @dreadstache
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.