Dispatch with multiple inheritance

Michael J. Fromberger Michael.J.Fromberger at Clothing.Dartmouth.EDU
Wed Jul 19 20:48:07 EDT 2006


In article <mailman.8352.1153350286.27775.python-list at python.org>,
 Michael Spencer <mahs at telcopartners.com> wrote:

> As others have pointed out, super, is designed to do something different from 
> what you want.  See 
> http://www.python.org/download/releases/2.2.3/descrintro/#cooperation for 
> GvR's 
>   explanation of super's intent, limitations, and a pure-python 
>   implementation 
> that you might alter for your purposes.

Indeed so.  The documentation for super() led me to an erroneous 
conclusion.  

> Given what you assert about your inheritance graph (two independent ancestor 
> chains, that do not propagate super calls from their respective base 
> classes), 
> what is objectionable about:
>  >   C.__init__(self, ...)
>  >   D.__init__(self, ...)

Well, since super() were much better labelled call_next_method, I must 
agree that the Class.__init__(self, ...) form is probably the best 
solution!

Thanks for your feedback.

Cheers,
-M

-- 
Michael J. Fromberger             | Lecturer, Dept. of Computer Science
http://www.dartmouth.edu/~sting/  | Dartmouth College, Hanover, NH, USA



More information about the Python-list mailing list