Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #12455 > unrolled thread

Re: Returning a value from exec or a better solution

Started byEthan Furman <ethan@stoneleaf.us>
First post2011-08-30 15:31 -0700
Last post2011-08-30 15:31 -0700
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Returning a value from exec or a better solution Ethan Furman <ethan@stoneleaf.us> - 2011-08-30 15:31 -0700

#12455 — Re: Returning a value from exec or a better solution

FromEthan Furman <ethan@stoneleaf.us>
Date2011-08-30 15:31 -0700
SubjectRe: Returning a value from exec or a better solution
Message-ID<mailman.588.1314742485.27778.python-list@python.org>
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.

Actually, I think it is unreasonable -- by modifying the globals or 
locals objects *after* the code has been exec'd, information is being 
removed about the environment the code ran in, making introspection (if 
nothing else) more difficult.

Good reasons are required to make life difficult (at least with Python).

~Ethan~

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web