mrstevegross wrote:
I'm trying to import a module so that the globals() of the importer
module are available to the imported module itself....

One awkward solution is to deliberately initialize mymod.py ....
That will work, but it's a bit ugly. Plus, I have to repeat it for
every module with the same problem (of which I have many!).

Nope.  Think about it.  Only the first import is anything but a dict
lookup.
Even if you know how you want that to work, suppose you use two
different modules in a single program, both of which define a
"builtin" named "somename".  Does the first one win? Does the second?
Does the last that actually imported?  There is a hack that can let
you change the builtins module, but you don't want to use it: you make
your programs harder to understand.
Accept that you may want a bit of boilerplate if you have a common
base, and start each use with something like:

    from base_functions import bibble, babble, bobble, bome

--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to