Fuzzyman a écrit :


Yes.. but that would mean that eval could only run code objects that
"consist[s] of a single expression".. which I doubt is the reality or
the intention.

Regards,
Fuzzyman
http://www.voidspace.org.uk/python/index.shtml


[Sorry, I deleted the commented lines because they were completely unreadable anyway]


It's exactly what eval is for : evaluate a single expression and return its result ! Try with strings : you can't even evaluate a statement ! You can only evaluate an expression !

And what would be the return result of a sequence of statement ?

If you want to execute a sequence, you want to use exec, not eval ...

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

Reply via email to