Inspecting multiple-inheritance

Terry Hancock hancock at anansispaceworks.com
Fri Apr 12 13:01:23 EDT 2002


Hi All,

I'm trying to understand a portion of Zope, which involves
highly multiply-inherited objects.  There are several
instances of methods being overloaded, and so I'm trying
to figure out "who wins".  In some cases there appear to
be as many as six classes inherited from, and each of
those may have three-to-six as well, so that in the end
there may be 20 or more superclasses to search.

I know I can find out what methods/attributes an object
has by using dir() -- but is it possible to figure out
what arguments they expect, or what superclass they
came from?  In this particular case, I'm trying to
determine where __init__ comes from, and what arguments
it expects, as I expect that I need to call the appropriate
__init__ from superclasses.

But in general, it seems like this would be an important
thing to be able to do, as this would seem to be a
hazard of object-oriented programming in general. I tried
to search the onsite documentation and Learning Python,
but I don't really know what I'm looking for.

Thanks for any suggestions or comments!

Cheers,
Terry

-- 
------------------------------------------------------
Terry Hancock
hancock at anansispaceworks.com       
Anansi Spaceworks                 
http://www.anansispaceworks.com 
P.O. Box 60583                     
Pasadena, CA 91116-6583
------------------------------------------------------





More information about the Python-list mailing list