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 mymod.py 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 http://mail.python.org/pipermail/python-list/2002-June/109090.html
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.  :-)

-Peter
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to