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 bethard
Recipients bethard, shima__shima, terry.reedy
Date 2012-07-21.20:19:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1342901980.49.0.747963561582.issue14392@psf.upfronthosting.co.za>
In-reply-to
Content
I can't find anywhere in the documentation where type=bool, type=unicode or type=long are disallowed. They shouldn't be disallowed. If you want to pass type=bool, argparse should not stop you. And it currently doesn't:

>>> parser = argparse.ArgumentParser()
>>> parser.add_argument('foo', type=bool)
>>> parser.parse_args([''])
Namespace(foo=False)
>>> parser.parse_args(['x'])
Namespace(foo=True)
History
Date User Action Args
2012-07-21 20:19:40bethardsetrecipients: + bethard, terry.reedy, shima__shima
2012-07-21 20:19:40bethardsetmessageid: <1342901980.49.0.747963561582.issue14392@psf.upfronthosting.co.za>
2012-07-21 20:19:39bethardlinkissue14392 messages
2012-07-21 20:19:39bethardcreate