Creating anonymous functions using eval

Devan L devlai at gmail.com
Tue Jul 12 12:16:29 EDT 2005


Well, the string that gets passed is more or less a function
definition, which is then called with exec. I don't see why you'd need
to write a string out with the function definition and then call it.
You could just write the function.

As for the nested functions, I had been presuming that it was intended
to use as a better function than lambda within a function. Sorry for
the confusion.




More information about the Python-list mailing list