Multiple inheritance with a common base class

Delaney, Timothy C (Timothy) tdelaney at avaya.com
Tue Aug 10 18:24:35 EDT 2004


Markus Bertheau wrote:

>> Using super will ensure that you get a reliable chain of method
>> calls. In this case it means that Multi.__init__ calls
>> LeafA.__init__ which calls LeafB.__init__ which then calls
>> CommonBase.__init__. Note that LeafA propogates the call to LeafB
>> even though LeafA has no knowledge of the existence of LeafB.
>
> That is what I needed to know. Thanks. It should probably be noted in
> the paragraph about multiple inheritance.

You may also wish to look at my "improved autosuper" recipe in the
cookbook.
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/286195

I've actually got a Pyrex version as well now that's about twice as fast
- I really need to put this somewhere for download ...

Tim Delaney 



More information about the Python-list mailing list