[issue14074] argparse allows nargs>1 for positional arguments but doesn't allow metavar to be a tuple

2021-11-26 Thread Irit Katriel
Irit Katriel added the comment: Reproduced on 3.11, with a different error: % ./python.exe prog.py Traceback (most recent call last): File "/Users/iritkatriel/src/cpython-1/prog.py", line 5, in args = parse.parse_args() ^^ File

[issue14074] argparse allows nargs>1 for positional arguments but doesn't allow metavar to be a tuple

2020-02-03 Thread Cyker Way
Cyker Way added the comment: Tuple support is documented: https://github.com/python/cpython/commit/98047eb806227f11212f6a42c242030a51964e30#diff-9c4a053d29149ba40370fb3e34faR1059 https://docs.python.org/3/library/argparse.html#metavar > Providing a tuple to ``metavar`` specifies a

[issue14074] argparse allows nargs>1 for positional arguments but doesn't allow metavar to be a tuple

2020-02-01 Thread hai shi
Change by hai shi : -- versions: +Python 3.9 -Python 3.5 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue14074] argparse allows nargs>1 for positional arguments but doesn't allow metavar to be a tuple

2020-02-01 Thread hai shi
hai shi added the comment: > Given that tuple metavars currently doesn't work, there is no backward > compatibility issue. What is being proposed is to give more friendly error > messages. Got it, thanks. > Paul suggested that it may be a better plan to just disallow tuple metavars > and

[issue14074] argparse allows nargs>1 for positional arguments but doesn't allow metavar to be a tuple

2020-02-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: > I am not sure disallowing tuple metavars would break backup > compatibility or not~ Given that tuple metavars currently doesn't work, there is no backward compatibility issue. What is being proposed is to give more friendly error messages.

[issue14074] argparse allows nargs>1 for positional arguments but doesn't allow metavar to be a tuple

2020-01-31 Thread hai shi
hai shi added the comment: I am not sure disallowing tuple metavars would break backup compatibility or not~ -- nosy: +shihai1991 versions: +Python 3.5 -Python 3.3 ___ Python tracker

[issue14074] argparse allows nargs>1 for positional arguments but doesn't allow metavar to be a tuple

2020-01-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: -0 on going forward with this. AFAICT, no one has requested tuple support (the OP just wanted better error handling). And more fined grained control can already be had just by specifying separate positional arguments. Paul suggested that it may be a

[issue14074] argparse allows nargs>1 for positional arguments but doesn't allow metavar to be a tuple

2018-12-01 Thread Cyker Way
Cyker Way added the comment: Can confirm this bug still exists on master branch, python3.7, python3.6, and very likely other versions since it's reported. It seems only `_format_action_invocation` and `_get_action_name` need to be fixed. So we can do it more lightweight (<10 lines).

[issue14074] argparse allows nargs>1 for positional arguments but doesn't allow metavar to be a tuple

2018-12-01 Thread Roundup Robot
Change by Roundup Robot : -- pull_requests: +10082 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue14074] argparse allows nargs>1 for positional arguments but doesn't allow metavar to be a tuple

2017-01-24 Thread paul j3
paul j3 added the comment: An alternative fix is to disallow tuple metavars for positionals. A tuple metavar may look nice in the usage. But a well selected dest seems better in the help line, and error messages. Using dest in all 3 roles, as we do now, is the simplest compromise.

[issue14074] argparse allows nargs>1 for positional arguments but doesn't allow metavar to be a tuple

2017-01-24 Thread paul j3
Changes by paul j3 : -- priority: normal -> high ___ Python tracker ___ ___