Poll on Eval in Python

TerryP bigboss1964 at gmail.com
Tue Oct 20 14:08:00 EDT 2009


On Oct 20, 4:30 pm, Nobody <nob... at nowhere.com> wrote:
> One language's "eval" isn't the same as another's. E.g. there's a big
> difference between Lisp's "eval" (which takes an s-expression as an
> argument) and an "eval" which takes a string as an argument.
>
> The former is fine; the latter should be prohibited by law, and preferably
> by international treaty.


The ability to eval a string can be useful in generating code from a
template at run time, among other things. Of course, those who want to
cram tainted ``supercalifragilisticexpialidocious'' input from GOD
knows where into an eval statement, should just be shot, hung, drawn,
and quartered - no need for a legal opinion before hand.

There is no such thing as a feature that is absolutely always wrong to
use, just brain damaged people to use it inappropriately ;). Just look
at the TOPS family...



More information about the Python-list mailing list