Skip to content

gh-69223: Document that add_argument() returns an Action object#145538

Merged
savannahostrowski merged 3 commits intopython:mainfrom
Bortlesboat:doc-argparse-add-argument-return
Mar 6, 2026
Merged

gh-69223: Document that add_argument() returns an Action object#145538
savannahostrowski merged 3 commits intopython:mainfrom
Bortlesboat:doc-argparse-add-argument-return

Conversation

@Bortlesboat
Copy link
Contributor

@Bortlesboat Bortlesboat commented Mar 5, 2026

Document that ArgumentParser.add_argument() returns an Action object. This is useful when callers need to reference the created action for further customization or inspection.

Closes #69223.


📚 Documentation preview 📚: https://cpython-previews--145538.org.readthedocs.build/

@bedevere-app bedevere-app bot added docs Documentation in the Doc dir skip news labels Mar 5, 2026
@python-cla-bot
Copy link

python-cla-bot bot commented Mar 5, 2026

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-app
Copy link

bedevere-app bot commented Mar 5, 2026

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 I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@savannahostrowski
Copy link
Member

@Bortlesboat In order to accept this contribution, we'll need you to sign the CLA left in the comment by the bot.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Member

@savannahostrowski savannahostrowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@savannahostrowski savannahostrowski added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Mar 6, 2026
@savannahostrowski savannahostrowski enabled auto-merge (squash) March 6, 2026 16:03
@savannahostrowski savannahostrowski merged commit b28e5f5 into python:main Mar 6, 2026
28 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in Docs PRs Mar 6, 2026
@miss-islington-app
Copy link

Thanks @Bortlesboat for the PR, and @savannahostrowski for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 6, 2026
…pythonGH-145538)

(cherry picked from commit b28e5f58ebf8d9badcc893cd189cb1575d4e3614)

Co-authored-by: Andrew Barnes <bortstheboat@gmail.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 6, 2026
…pythonGH-145538)

(cherry picked from commit b28e5f5)

Co-authored-by: Andrew Barnes <bortstheboat@gmail.com>
@bedevere-app
Copy link

bedevere-app bot commented Mar 6, 2026

GH-145595 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Mar 6, 2026
@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Mar 6, 2026
@bedevere-app
Copy link

bedevere-app bot commented Mar 6, 2026

GH-145596 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

argparse: document that add_argument returns an Action object

2 participants