Author lanzz
Recipients Sworddragon, berker.peksag, bethard, ced, eric.araujo, eric.smith, lanzz, macfreek, paul.j3, regis, rhettinger, sebix, thesociable
Date 2019-11-18.11:14:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1574075670.7.0.0400185102884.issue9625@roundup.psfhosted.org>
In-reply-to
Content
It looks like choices are broken for nargs='*' even without using default:

>>> import argparse
>>> parser = argparse.ArgumentParser()
>>> parser.add_argument('test', nargs='*', choices=['foo', 'bar', 'baz'])
_StoreAction(option_strings=[], dest='test', nargs='*', const=None, default=None, type=None, choices=['foo', 'bar', 'baz'], help=None, metavar=None)
>>> parser.parse_args([])
usage: [-h] [{foo,bar,baz} [{foo,bar,baz} ...]]
: error: argument test: invalid choice: [] (choose from 'foo', 'bar', 'baz')
History
Date User Action Args
2019-11-18 11:14:30lanzzsetrecipients: + lanzz, rhettinger, bethard, macfreek, eric.smith, eric.araujo, ced, Sworddragon, thesociable, regis, berker.peksag, paul.j3, sebix
2019-11-18 11:14:30lanzzsetmessageid: <1574075670.7.0.0400185102884.issue9625@roundup.psfhosted.org>
2019-11-18 11:14:30lanzzlinkissue9625 messages
2019-11-18 11:14:30lanzzcreate