[issue45673] argparse error with option with optional value

paul j3 report at bugs.python.org
Tue Nov 2 18:09:14 EDT 2021


paul j3 <ajipanca at gmail.com> added the comment:

https://bugs.python.org/issue9338
argparse optionals with nargs='?', '*' or '+' can't be followed by positionals

As you can see this is an old issue, but still too big for a quick fix.

As a general rule, don't use `nargs` like this where there's ambiguity as to how many values will be allocated to the argument.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45673>
_______________________________________


More information about the Python-bugs-list mailing list