paul j3 added the comment: 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 ---------- nosy: +paul.j3 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26994> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com