On Mon, 12 Mar 2007, Greg Ewing wrote:
> Changing __main__ to match would seem to be a
> good idea.
[...]
> There might be merit in renaming __builtins__
> to something less confusable, at the expense of
> breaking existing code which refers to it.

Cool.

> I don't think it would be such a good
> idea to unify __builtin__ and __builtins__,
> because then importing __builtin__ would clobber
> the existing builtin namespace being used by
> the code -- which may not be the same thing.

We have "import as", though.  If you want to import the default
builtins without using them as the builtins, you can say

    import __builtin__ as default_builtin

If you want to reset the builtins to the default builtins:

    import __builtin__

If you want to replace them with your own builtins:

    import my_builtin as __builtin__

That doesn't seem so bad.

Hmm... when do you find yourself importing __builtin__?


-- ?!ng
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to