This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vreuter
Recipients vreuter
Date 2021-04-16.20:35:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1618605356.69.0.0775347773509.issue43876@roundup.psfhosted.org>
In-reply-to
Content
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
History
Date User Action Args
2021-04-16 20:35:56vreutersetrecipients: + vreuter
2021-04-16 20:35:56vreutersetmessageid: <1618605356.69.0.0775347773509.issue43876@roundup.psfhosted.org>
2021-04-16 20:35:56vreuterlinkissue43876 messages
2021-04-16 20:35:56vreutercreate