[Python-Dev] [poll] New name for __builtins__

Guido van Rossum guido at python.org
Sat Dec 1 01:21:56 CET 2007


On Nov 30, 2007 3:59 PM, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> Terry Reedy wrote:
> > The only problem would be if someone put
> > the incantation into a non-main module named 'main.py', but the same is
> > true today of '__main__.py'.  And I would consider either a buggy practice.
>
> I often put the "real" main code into a separate module, so
> that it gets compiled to a .pyc, and sometimes I call that
> module "main.py". So this change would break a lot of my
> programs, and perhaps other people's as well.
>
> I think the situation with __main__ is different from __builtin__,
> because __builtin__ is an actual, specific module, whereas
> __main__ is a pseudo-module which stands in for a different thing
> in every Python program. So I'm in favour of keeping an
> __xxx__ name for it, to emphasise its magic nature. I'm much
> less likely to accidentally stomp on a magic name than a
> non-magic one.

Right. Rest assured, __main__ is not going to change.

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


More information about the Python-Dev mailing list