argparse: positional with nargs=*
results in ignored option argument if they share a dest
#101990
Labels
type-bug
An unexpected behavior, bug, or error
Bug report
Given the following example:
Passing positional arguments works as expected.
However, the option arguments are ignored.
❯ python /tmp/test.py --foo bar {'foo': []}
As a workaround, you can set a separate
dest
and handle this in your application.fwiw, I am using this to deprecate a positional argument in favour of an option argument (using exclusive groups) but this is a minimal reproducer.
Your environment
The text was updated successfully, but these errors were encountered: