merging the global namespaces of two modules

Jeff jeffober at gmail.com
Thu May 22 08:10:42 EDT 2008


Can you be more specific?  modA and modB don't import from each other
but both need to access objects in the global namespace of what
module?  The controlling application?  Or do you mean that, for
example, modA needs to access some functions in modB, but does not
have import statements to do so, and you want the controlling program
to do the imports for it?  If that is the case, that is bad
programming practice in Python.  Python is not C and you can't just
share header files :)

If you need to avoid recursive import conflicts, you can perform your
imports at the top of functions that use objects from another module.

Jeff
http://www.artfulcode.net



More information about the Python-list mailing list