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 paul.j3
Recipients Nathan Naze, paul.j3, r.david.murray
Date 2016-05-14.17:00:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1463245250.67.0.93152185614.issue26994@psf.upfronthosting.co.za>
In-reply-to
Content
I answered a similar question recently on Stackoverflow when the user wanted to use `type=hex`.

http://stackoverflow.com/questions/37006387/python-argparse-hex-error


In another recent bug/issue the poster want a `enum` type.  It's not hard to define a function, or factory class, that handles mappings like this, but it isn't as simple or intuitive as some would like.

There is a registries mechanism, which could allow the user to use `type='bool'`, where 'bool' is the name of a function that that converts some set of strings to True/False.  But people are used to providing strings for the `action`, they aren't used to do so for the `type`.

http://stackoverflow.com/questions/15008758/parsing-boolean-values-with-argparse
History
Date User Action Args
2016-05-14 17:00:50paul.j3setrecipients: + paul.j3, r.david.murray, Nathan Naze
2016-05-14 17:00:50paul.j3setmessageid: <1463245250.67.0.93152185614.issue26994@psf.upfronthosting.co.za>
2016-05-14 17:00:50paul.j3linkissue26994 messages
2016-05-14 17:00:50paul.j3create