This sounds like modifying the __builtin__
name space. To do it:
import __builtin__
__builtin__.foo = 'some-value'
Do not use the __builtins__
directly (notice the extra "s") - apparently this can be a dictionary or a module. Thanks to ??O????? for pointing this out, more can be found here.
Now foo
is available for use everywhere.
I don't recommend doing this generally, but the use of this is up to the programmer.
Assigning to it must be done as above, just setting foo = 'some-other-value'
will only set it in the current namespace.