FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-138697: Fix inferring dest from a single-dash long option in argparse by serhiy-storchaka · Pull Request #138699 · python/cpython · GitHub

Repository navigation

gh-138697: Fix inferring dest from a single-dash long option in argparse - #138699

Merged
savannahostrowski merged 5 commits into
python:mainfrom
serhiy-storchaka:argparse-single-dash-long-option-dest
Nov 20, 2025
Merged

savannahostrowski merged 5 commits into
python:mainfrom
serhiy-storchaka:argparse-single-dash-long-option-dest

Conversation

serhiy-storchaka commented Sep 9, 2025 •
edited by github-actions Bot
Loading

Copy link
Copy Markdown
Member

If a short option and a single-dash long option are passed to add_argument(), dest is now inferred from the single-dash long option.


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

… argparse

If a short option and a single-dash long option are passed to add_argument(),
dest is now inferred from the single-dash long option.
serhiy-storchaka force-pushed the argparse-single-dash-long-option-dest branch from 9987fa1 to 426169f Compare September 9, 2025 10:14
serhiy-storchaka linked an issue Sep 19, 2025 that may be closed by this pull request

savannahostrowski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Overall, I am supportive of making dest more consistent so thanks for opening this issue and PR. However, there is one edge case that still needs to be addressed.

Comment thread Lib/argparse.py Outdated

bedevere-app Bot commented Nov 20, 2025

Copy link
Copy Markdown

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

Copy link
Copy Markdown
Member Author

I have made the requested changes; please review again.

bedevere-app Bot commented Nov 20, 2025

Copy link
Copy Markdown

Thanks for making the requested changes!

@savannahostrowski: please review the changes made to this pull request.

savannahostrowski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM! Thanks for this!

savannahostrowski enabled auto-merge (squash) November 20, 2025 18:11
savannahostrowski merged commit 77cb39e into python:main Nov 20, 2025
46 checks passed
serhiy-storchaka deleted the argparse-single-dash-long-option-dest branch November 20, 2025 19:26
StanFromIreland pushed a commit to StanFromIreland/cpython that referenced this pull request Dec 6, 2025
… argparse (python#138699)

* pythongh-138697: Fix inferring dest from a single-dash long option in argparse

If a short option and a single-dash long option are passed to add_argument(),
dest is now inferred from the single-dash long option.

* Make double-dash options taking priority over single-dash long options.

---------

Co-authored-by: Savannah Ostrowski <savannah@python.org>
ashm-dev pushed a commit to ashm-dev/cpython that referenced this pull request Dec 8, 2025
… argparse (python#138699)

* pythongh-138697: Fix inferring dest from a single-dash long option in argparse

If a short option and a single-dash long option are passed to add_argument(),
dest is now inferred from the single-dash long option.

* Make double-dash options taking priority over single-dash long options.

---------

Co-authored-by: Savannah Ostrowski <savannah@python.org>
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inferring dest from a single-dash long option

2 participants


Back | FazBrowse Home | New Git URL