Returning a value from exec or a better solution

Ethan Furman ethan at
Tue Aug 30 18:28:16 EDT 2011

Rob Williscroft wrote:
> Arnaud Delobelle wrote:
>> That's not an issue. The last statement that is executed will be the
>> "def" statement.
> You don't know that, an implementation may for example set __bultins__ 
> to None, prior to returning, its not an unreasonable thing to do and
> the docs don't say they can't.

Yet another excellent reason to have unit tests!


More information about the Python-list mailing list