Closed andrey-klochkov-liftoff closed 2 years ago
This example works if I set nargs='?'
in addition to type
. I'm closing the issue.
Yeah, this is one of the weird things with argparse: When you pass a type
to argparse (which is essentially what is happening here, the field
just passes the type
to the parser.add_argument
method), it gets called with every value that is passed, when nargs=="*"
or > 1.
Is it possible to parse comma-separated lists like e.g.
--listarg 1,2,3
?I attempted to do the following, but I get a list with a nested list as a result.