[Python-Dev] string to float containing whitespace (original) (raw)
"Martin v. Löwis" martin at v.loewis.de
Wed Apr 29 23:17:32 CEST 2009
- Previous message: [Python-Dev] string to float containing whitespace
- Next message: [Python-Dev] Installing Python 2.5.4 from Source under Windows
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
skip at pobox.com wrote:
Someone please tell me I'm not going mad. I could have sworn that once upon a time attempting to convert numeric strings to ints or floats if they contained whitespace raised an exception. As far back as 1.5.2 it appears that float(), string.atof() and string.atoi() allow whitespace. Maybe I'm thinking of trailing non-numeric, non-whitespace characters.
Maybe you remember truly embedded whitespace:
py> float("1. 3") Traceback (most recent call last): File "", line 1, in ValueError: invalid literal for float(): 1. 3
Regards, Martin
- Previous message: [Python-Dev] string to float containing whitespace
- Next message: [Python-Dev] Installing Python 2.5.4 from Source under Windows
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]