Newbie namespace question

Peter Hansen peter at
Wed Dec 22 17:06:42 CET 2004

Steve Holden wrote:
> then in some other module (and here specifically in the interactive 
> interpreter) you can bind a value to "myname" in __builtins__ and it 
> will be seen by when it's imported:
>  >>> __builtins__.myname = "MyValue"

Steve's basic premise is correct, but he's chosen the wrong
name to use.  As Fredrik Lundh has written here
the name above is an implementation detail and one should
always do this instead:

import __builtin__
__builtin__.myname = "MyValue"

And doing so reinforces the idea that this is Almost Always
a Bad Idea.  :-)


More information about the Python-list mailing list