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 jessehostetler, pablogsal, paul.j3, xtreak
Date 2018-09-27.03:35:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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.
Date User Action Args
2018-09-27 03:35:49paul.j3setrecipients: + paul.j3, pablogsal, xtreak, jessehostetler
2018-09-27 03:35:49paul.j3setmessageid: <>
2018-09-27 03:35:49paul.j3linkissue34803 messages
2018-09-27 03:35:49paul.j3create