gh-137988: Fix const description in argparse.add_argument() docs#138315
Merged
savannahostrowski merged 3 commits intopython:mainfrom Sep 17, 2025
Merged
gh-137988: Fix const description in argparse.add_argument() docs#138315savannahostrowski merged 3 commits intopython:mainfrom
savannahostrowski merged 3 commits intopython:mainfrom
Conversation
Contributor
Author
|
Hi, just checking in on this PR — would really appreciate it if you could take a look whenever you get a chance. Thanks! |
savannahostrowski
approved these changes
Sep 17, 2025
Member
savannahostrowski
left a comment
There was a problem hiding this comment.
Thank you for the PR! LGTM!
|
Thanks @PrinceNaroliya 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
Sep 17, 2025
pythonGH-138315) (cherry picked from commit 37425fe) Co-authored-by: PrinceNaroliya <naroliyaprince@gmail.com> Co-authored-by: Savannah Bailey <savannahostrowski@gmail.com>
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Sep 17, 2025
pythonGH-138315) (cherry picked from commit 37425fe) Co-authored-by: PrinceNaroliya <naroliyaprince@gmail.com> Co-authored-by: Savannah Bailey <savannahostrowski@gmail.com>
|
GH-139051 is a backport of this pull request to the 3.14 branch. |
|
GH-139052 is a backport of this pull request to the 3.13 branch. |
hugovk
pushed a commit
that referenced
this pull request
Sep 17, 2025
savannahostrowski
added a commit
that referenced
this pull request
Sep 17, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What does this PR do?
This PR fixes a documentation issue in the
argparsemodule related to theadd_argument()method when usingnargs='?'.Previously, the docs stated:
This is incorrect. The correct behavior is:
This PR updates the documentation to reflect the correct behavior.
Related Issue
Fixes: #137988
Type of Change
How to Verify
Open
Doc/library/argparse.rst.Locate the passage describing
nargs='?'andconst.Confirm the updated sentence is:
"the value from
constwill be used."Build HTML docs (optional) to verify changes:
Checklist
📚 Documentation preview 📚: https://cpython-previews--138315.org.readthedocs.build/