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.
❯ python /tmp/test.py bar {'foo': ['bar']}However, the option arguments are ignored.
❯ python /tmp/test.py --foo bar {'foo': []}As a workaround, you can set a separate
destand 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: