not at Python Bugs -- __builtins__ madness

Gordon McMillan gmcm at hypernet.com
Sat Mar 11 16:58:37 EST 2000


> Could some please explain how Python makes this mistake?
> 
>   jeffp at friday [4:15pm] bin #324> python
>   Python 1.5.2 (#1, Apr 20 1999, 08:57:03)  [GCC 2.7.2.3] on sunos5
>   Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>   >>> __builtins__
>   <module '__builtin__' (built-in)>
> 
> It got the module name wrong.  Unless Python treats __builtins__ THAT
> specially, that's a major goof.  And the 1.5.2 docs say it's
> __builtin__.  This boggles my poor mind.  I'm checking Python Bugs...

No mistake. __builtin__ is a module. __builtins__ is a name 
which normally refers to __builtin__, but may not (eg, in 
restricted execution).

- Gordon




More information about the Python-list mailing list