Single type for __builtins__ in Py3.0

Collin Winter collinw at gmail.com
Sat Sep 24 00:46:48 EDT 2005


On 9/23/05, Peter Hansen <peter at engcorp.com> wrote:
> My point, which might not have been clear, is that users are *already*
> told that they shouldn't ever touch __anything__ without understanding
> what it is, which is more general advice than and therefore encompasses
> the __builtins__ issue.  For this reason I believe the existing advice
> is sufficient for everyone except those who would probably also end up
> ignoring your above suggestions anyway.

I'm not proposing a new rule on the level of "learn about __foo__
before you mess with it"; the delegation structure of that rule is
sufficient. I do however want the docs for __builtins__ to explicitly
mention a) that you should do your mucking with __builtin__ instead,
and b) that __builtins__ is a module when in __main__ and a dict
everywhere else; the current documentation makes no mention of either.
Come morning I'll submit a patch for the reference manual.

>  > Maybe
>  > __builtins__ could be removed entirely from Py3.0, thus bringing
>  > reality in to sync with policy.
>
> That's a possibility, though given that it's an implementation detail
> there could easily be other implementation details which you would then
> be asking to be removed as well because they might confuse someone.  If
> you really want to avoid having implementation details exposed like
> this, you should probably be participating closely in the development
> process.  ;-)

I'm relatively new to the python-dev world, but I intend to do what I
can to eliminate blemishes like __builtins__.

Collin Winter



More information about the Python-list mailing list