Skip to content

bpo-41047: fix argparse misbehavior with choices and nargs='*'#20997

Closed
jameshcorbett wants to merge 1 commit intopython:masterfrom
jameshcorbett:argparse-positionals-and-choices
Closed

bpo-41047: fix argparse misbehavior with choices and nargs='*'#20997
jameshcorbett wants to merge 1 commit intopython:masterfrom
jameshcorbett:argparse-positionals-and-choices

Conversation

@jameshcorbett
Copy link
Copy Markdown
Contributor

@jameshcorbett jameshcorbett commented Jun 20, 2020

The argparse.ArgumentParser sometimes rejects positional arguments with no arguments when choices is set and nargs="*". This PR would fix that, so they would never be rejected. This would make the behavior of positional arguments align with the behavior of optional arguments in this specific case.

https://bugs.python.org/issue41047

@csabella csabella requested a review from rhettinger June 20, 2020 12:37
@jameshcorbett jameshcorbett deleted the argparse-positionals-and-choices branch June 25, 2020 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants