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 eric.smith
Recipients JimmyCarlos, eric.smith
Date 2021-04-11.17:24:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1618161894.97.0.570422067374.issue43808@roundup.psfhosted.org>
In-reply-to
Content
Wouldn't the next thing you do be to convert it to a float, so you'd call float() twice? I think you'd be better off just catching the exception yourself, and using the result of float().

I'm opposed to such a simple function being a member of str or in the stdlib. In all of my years using Python with plenty of floats, I've never needed this function.

The usual suggestion with such short functions it to just add them to your own utility library.
History
Date User Action Args
2021-04-11 17:24:55eric.smithsetrecipients: + eric.smith, JimmyCarlos
2021-04-11 17:24:54eric.smithsetmessageid: <1618161894.97.0.570422067374.issue43808@roundup.psfhosted.org>
2021-04-11 17:24:54eric.smithlinkissue43808 messages
2021-04-11 17:24:54eric.smithcreate