module organization/inheritance problem
km
srikrishnamohan at gmail.com
Fri Dec 7 10:52:53 EST 2007
Hi all,
I have a python module (M) with the following structure
M (directory)
| __init__.py (class Base(object) ...)
| - a.py (class A(Base) ...)
| - b.py (class B(Base) ...)
| - c.py (class C(Base) ...)
The __init_.py has a class which all the sub-modules (a,b,c) classes
inherit from.
* The class has an __init__ method which imports certian modules and
nothing more
* Each submodule (a,b,c) has a class each which are derived from the class
defined in __init__.py
* Each submodule's classe's __init__ method extends the base class __init__
method and imports some more modules specific to be used in that class
I have thought of such subclassing to avoid repetition of importing modules
across the directory hierarchy beneath.
Now is the class defined in __init__.py is not acessible to the submodules.
what could be done to make it work ? am i missing something ?
regards,
KM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20071207/a9ac3eb6/attachment.html>
More information about the Python-list
mailing list