]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-85935: Check for nargs=0 for positional arguments in argparse (GH-124839)
authorSerhiy Storchaka <storchaka@gmail.com>
Sat, 12 Oct 2024 13:04:17 +0000 (16:04 +0300)
committerGitHub <noreply@github.com>
Sat, 12 Oct 2024 13:04:17 +0000 (16:04 +0300)
commit9944ad388c457325456152257b977410c4ec3593
tree0c10a13b73c508ac8fb7af984dde584b3d5afa3b
parent63cf4e914f879ee28a75c02e867baa7c6047ea2b
gh-85935: Check for nargs=0 for positional arguments in argparse (GH-124839)

Raise ValueError in add_argument() if either explicit nargs=0 or action
that does not consume arguments (like 'store_const' or 'store_true') is
specified for positional argument.
Lib/argparse.py
Lib/test/test_argparse.py
Misc/NEWS.d/next/Library/2024-10-01-13-11-53.gh-issue-85935.CTwJUy.rst [new file with mode: 0644]