Quote:
Originally Posted by LoneAngelIbesu
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.