paul j3 <ajipa...@gmail.com> added the comment:
The `type` parameter is normally a function (or more generally a callable). When given a string it should convert it as needed, or raise an error. In your example that function is the stock, 'int()'. Test `int('123')`, `int('1e3')` etc for yourself to see what it can handle. If you want to convert '1e3' to an integer, write your own function that handle it. Don't expect argparse or the stock int() to do it for you. More commonly people use 'type=bool', expecting it convert 'True' or 'False' strings to boolean values. But that's not what the bool() function does. To reiterate, 'type' is a function, not a desired class. Since this is not a bug, I think this should be closed. ---------- nosy: +paul.j3 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue34803> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com