Inheriting Python modules?

Timo Linna timo.SPAM.linna at iki.ME.fi.NOT.invalid
Tue Dec 18 14:23:59 EST 2001


"Jeff Shannon" <jeff at ccvcorp.com> wrote in message
news:3C1F8EE5.668EF8C6 at ccvcorp.com...
>
> This is untested, but ISTM that if, inside your defaults.py, you import
the
> other module(s) using "from othermodule import *", it will have the effect
you
> want.  (I'm pretty sure that wxPython, at least, uses this technique.)  Of
> course, you'll have to be careful to not cause any namespace conflicts
amongst
> your modules.  This is, however, one of the few legitimate uses of "from
module
> import *" (IMHO).

Ok, this might work, but its exactly the thing I don't want to do (i.e.
defining dummy logical modules).

I found some examples of using built-in module 'imp' and now I think the
internal __import__-function should be overriden.

-- timo






More information about the Python-list mailing list