On Wed, Mar 7, 2012 at 10:56, Benjamin Peterson <benja...@python.org> wrote:

> 2012/3/7 Mark Shannon <m...@hotpy.org>:
> > Currently, it is impossible to allow one function access to sensitive
> > functions like open(), while denying it to others, as any code can then
> > get the builtins of another function via f.__globals__['builtins__'].
> > Separating builtins from globals could solve this.
>
> I like this idea. We could finally kill __builtins__, too, which has
> often been confusing for people.


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).
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to