multiple inheritance & __init__

Greg Ewing see_reply_address at something.invalid
Thu Jul 4 21:16:27 EDT 2002


Stephane Ninin wrote:

> is there any reason to choose this order:
> 
>   Observer.__init__(self)
>   Tkinter.Listbox(self)
> 
> or this order:
> 
>   Tkinter.Listbox(self)
>   Observer.__init__(self)


If the classes Observer and Tkinter.Listbox don't
know anything about each other, then the order
shouldn't matter.

It would only matter if, for example, Observer
expected to be mixed in with a Tkinter widget
and required the widget to be initialised first.
If there are no such dependencies, the order is
up to you.

-- 
Greg Ewing, Computer Science Dept,
University of Canterbury,	
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg




More information about the Python-list mailing list