[issue43808] Add .isfloat() method to str

2021-04-11 Thread Gregory P. Smith
Change by Gregory P. Smith : -- resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Pytho

[issue43808] Add .isfloat() method to str

2021-04-11 Thread Eric V. Smith
Eric V. Smith added the comment: 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 s

[issue43808] Add .isfloat() method to str

2021-04-11 Thread JimmyCarlos
New submission from JimmyCarlos : Hello Python Community! One feature I think would be helpful would be a method to see if a str can be safely converted into a float. Currently, this is not doable without a long regex or a try-except block, as numbers like "-3.52" contain non-numeric symbols