On Mon, Dec 17, 2012 at 1:00 PM, Alan Gauld <alan.ga...@btinternet.com> wrote:
>
> Python uses its own C code for this.

The important point here is that they use the strtol/strtod interface,
however it's implemented. atoi and atof lack the end pointer argument
that enables raising a ValueError for an incomplete conversion. For
example, strtol("123e9", &end, 10) will merrily return 123, but with
*end == 'e'. I think it's good that Python raises a ValueError in this
case.

    Errors should never pass silently.
    Unless explicitly silenced.

http://www.python.org/dev/peps/pep-0020/
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to