Message391255
Standard library docs for argparse, at https://docs.python.org/3/library/argparse.html#nargs, suggest that setting nargs='+' differs from nargs='*' in that the former will raise a parsing error when the argument's omitted while the latter will not. In other words, nargs='+' sounds like it's distinguished from nargs='*' by virtue of implicitly making `required=True`. This implication isn't valid when the option name has a double-hyphen prefix, though: no argument parsing error is thrown for a double-hyphen-prefix-named option, even with `nargs='+'`. The docs neglect to mention this qualification that prevents `nargs='+'` from implicitly making the option required. Originally noticed while using a port of the library to R: https://github.com/trevorld/r-argparse/issues/31 |
|
Date |
User |
Action |
Args |
2021-04-16 20:35:56 | vreuter | set | recipients:
+ vreuter |
2021-04-16 20:35:56 | vreuter | set | messageid: <1618605356.69.0.0775347773509.issue43876@roundup.psfhosted.org> |
2021-04-16 20:35:56 | vreuter | link | issue43876 messages |
2021-04-16 20:35:56 | vreuter | create | |
|