There is no need of a three_way_flag - just use a conditional expression 
instead of an if-elif-else block,

str.isfloat uses the int() and float() functions, so, in your example, if float 
returns inf we can still return True (or maybe return None in this case too). 
If int() raises overflow error, then str.isfloat() would fail as well.

Regarding use cases of str.isfloat, I have replied above.
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/NZ4Y76HRBPRNJIJMI5QXQQIIIU5ED6F5/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to