<br><br><div class="gmail_quote">On Wed, Mar 7, 2012 at 10:56, Benjamin Peterson <span dir="ltr"><<a href="mailto:benjamin@python.org">benjamin@python.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
2012/3/7 Mark Shannon <<a href="mailto:mark@hotpy.org">mark@hotpy.org</a>>:<br>
<div class="im">> Currently, it is impossible to allow one function access to sensitive<br>
> functions like open(), while denying it to others, as any code can then<br>
> get the builtins of another function via f.__globals__['builtins__'].<br>
> Separating builtins from globals could solve this.<br>
<br>
</div>I like this idea. We could finally kill __builtins__, too, which has<br>
often been confusing for people.</blockquote><div><br></div><div>I like it as well. It's a mess right now to try to grab the __import__() implementation and this would actually help clarify import semantics by saying that __import__() for any chained imports comes from __import__()s locals, globals, or builtins arguments (in that order) or from the builtins module itself (i.e. tstate->builtins).</div>
</div>