Thread: float()
View Single Post
  #29  
Old 08-18-2010, 12:48 AM
Riot Riot is offline
Delteria Management
Join Date: Nov 2003
Location: Seminole County, Florida
Posts: 280
Riot is on a distinguished road
Quote:
Originally Posted by LoneAngelIbesu View Post
What doesn't make sense about float('123str') returning 123? Just look at it semantically: float() does not imply a function that checks if there are non-mathematical characters. It implies returning a float value.
I'm not saying it doesn't make sense, just that returning -1 (a perfectly valid value) on error makes less sense.

Last edited by Riot; 08-18-2010 at 12:58 AM.. Reason: Reworded..
Reply With Quote