eval vs. atof

Dirk-Ulrich Heise hei at adtranzsig.de
Wed Dec 22 05:44:18 EST 1999


1. eval() means a call to the Python parser.
That's slower than having a specialized
number parsing routine.
2. If you want the user to input a number, but parse
his input with eval(), a user knowing about that
(or suspecting it) might try to crash or spy out your system
by entering arbitrary Python expressions.
--
Dipl.Inform. Dirk-Ulrich Heise
hei at adtranzsig.de
dheise at debitel.net


Sposhua schrieb in Nachricht ...
>Newbie...
>
>Why do string.ato[f/i/l] exist when you can use eval()? There must be a
reason
>for these things...
>





More information about the Python-list mailing list