Skip to content

gh-72795: Make positional arguments with nargs='*' or REMAINDER non-required #124306

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

Merged

Conversation

serhiy-storchaka
Copy link
Member

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

This allows to use positional argument with nargs='*' and without default in mutually exclusive group and improves error message about required arguments.

… non-required

This allows to use positional argument with nargs='*' and without default
in mutually exclusive group and improves error message about required
arguments.
@serhiy-storchaka
Copy link
Member Author

The part of this PR fixed also #63143, so I extracted it into separate PR #124307 (with adding tests). This PR should be merged after #124307.

@serhiy-storchaka serhiy-storchaka enabled auto-merge (squash) September 24, 2024 07:32
@serhiy-storchaka serhiy-storchaka merged commit 3c83f99 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.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 24, 2024
… non-required (pythonGH-124306)

This allows to use positional argument with nargs='*' and without default
in mutually exclusive group and improves error message about required
arguments.
(cherry picked from commit 3c83f99)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-app
Copy link

bedevere-app bot commented Sep 24, 2024

GH-124421 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 Sep 24, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 24, 2024
… non-required (pythonGH-124306)

This allows to use positional argument with nargs='*' and without default
in mutually exclusive group and improves error message about required
arguments.
(cherry picked from commit 3c83f99)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-app
Copy link

bedevere-app bot commented Sep 24, 2024

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

@bedevere-app bedevere-app bot removed the needs backport to 3.12 only security fixes label Sep 24, 2024
@serhiy-storchaka serhiy-storchaka deleted the argparse-required-zero-or-more branch September 24, 2024 08:43
serhiy-storchaka added a commit that referenced this pull request Sep 24, 2024
…R non-required (GH-124306) (GH-124422)

This allows to use positional argument with nargs='*' and without default
in mutually exclusive group and improves error message about required
arguments.
(cherry picked from commit 3c83f99)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
serhiy-storchaka added a commit that referenced this pull request Oct 7, 2024
…R non-required (GH-124306) (#124421)

This allows to use positional argument with nargs='*' and without default
in mutually exclusive group and improves error message about required
arguments.
(cherry picked from commit 3c83f99)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
jodal added a commit to mopidy/mopidy that referenced this pull request Oct 13, 2024
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.

1 participant