>> Maybe string.ato[if] used to behave that way?

    John> Nope.
    ...

OK, I remember what it was.  The C atof()/atoi() functions will stop at the
first non-numeric character.  (I believe the more modern strtod/strtof
functions behave the same way.)  You could thus call

    atof(" 12345 abcdef")

and get back 12345.  That I'm certain is an error in Python.  Somewhere in
my small walnut of a brain I must have conflated that with numeric strings
which contain extraneous whitespace but no other extra characters.

Skip
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to