[Python-Dev] Fast access to __builtins__

Guido van Rossum guido@python.org
Fri, 28 Mar 2003 09:26:11 -0500


> > BTW, I expect that nonstandard builtins will be ruled out in some
> > future version of the language, or will have to be declared
> > differently.  They are too confusing for the human reader of the code.
> 
> When you say "nonstandard builtins", do you mean nonstandard names
> or nonstandard values, or both?  E.g. assigning gettext.ugettext()
> to builtin _() or setting open() to some debugging func.

Nonstandard names.  The compiler can't know what's in __builtin__,
but it can know the names of the official built-ins.

> I wouldn't want to completely disallow these, but I'd be happy if
> you had to do something special and/or (more) explicit to make them
> work.

"from __builtin__ import open" should do it.

--Guido van Rossum (home page: http://www.python.org/~guido/)