Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-63143: Fix parsing mutually exclusive arguments in argparse #124307

Merged

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Sep 21, 2024

Arguments with the value identical to the default value (e.g. booleans, small integers, empty or 1-character strings) are no longer considered "not present".

Arguments with the value identical to the default value (e.g. booleans,
small integers, empty or 1-character strings) are no longer considered
"not present".
@rruuaanng
Copy link
Contributor

It seems that this issue is very similar to issue #109990 (that issue is to ignore existing optional parameters), but its PR has not been reviewed for a long time.

@serhiy-storchaka
Copy link
Member Author

I do not think that these issues are similar. #109990 is rather similar to #59317, in sense that both can only be solved by drastic rewriting of the algorithm. I will look if the proposed PR provides at least partial solution.

@serhiy-storchaka serhiy-storchaka merged commit 3094cd1 into python:main Sep 24, 2024
34 checks passed
@miss-islington-app
Copy link

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

@serhiy-storchaka serhiy-storchaka deleted the argparse-exclusive-default branch September 24, 2024 07:23
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 24, 2024
…ythonGH-124307)

Arguments with the value identical to the default value (e.g. booleans,
small integers, empty or 1-character strings) are no longer considered
"not present".
(cherry picked from commit 3094cd1)

Co-authored-by: Serhiy Storchaka <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Sep 24, 2024

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 24, 2024
…ythonGH-124307)

Arguments with the value identical to the default value (e.g. booleans,
small integers, empty or 1-character strings) are no longer considered
"not present".
(cherry picked from commit 3094cd1)

Co-authored-by: Serhiy Storchaka <[email protected]>
@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Sep 24, 2024
@bedevere-app
Copy link

bedevere-app bot commented Sep 24, 2024

GH-124419 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label Sep 24, 2024
serhiy-storchaka added a commit that referenced this pull request Sep 24, 2024
…GH-124307) (GH-124419)

Arguments with the value identical to the default value (e.g. booleans,
small integers, empty or 1-character strings) are no longer considered
"not present".
(cherry picked from commit 3094cd1)

Co-authored-by: Serhiy Storchaka <[email protected]>
serhiy-storchaka added a commit that referenced this pull request Oct 7, 2024
…GH-124307) (GH-124418)

Arguments with the value identical to the default value (e.g. booleans,
small integers, empty or 1-character strings) are no longer considered
"not present".
(cherry picked from commit 3094cd1)

Co-authored-by: Serhiy Storchaka <[email protected]>
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.

2 participants