Does Python have Multiple Inheritance ?

Larry Bates larry.bates at vitalEsafe.com
Sun Nov 9 16:13:09 EST 2008


Lawrence D'Oliveiro wrote:
> In message <mailman.3675.1226101014.3487.python-list at python.org>, Steve
> Holden wrote:
> 
>> Lawrence D'Oliveiro wrote:
>>
>>> In message
>>> <90d2b348-73b4-446d-9673-3de62927d146 at d42g2000prb.googlegroups.com>,
>>> Michele Simionato wrote:
>>>
>>>> On Nov 7, 4:38 pm, Tim Golden <m... at timgolden.me.uk> wrote:
>>>>
>>>>> Seriously, though, although Python does indeed support multiple
>>>>> inheritance, I have the impression from comments over the years that
>>>>> it's used a lot less than in other languages where it is more of a
>>>>> common idiom.
>>>> The reason is that in Python using composition is very easy, so there
>>>> is little need for MI (which is a Good Thing).
>>> Not to mention duck typing, which does away with the need for inheritance
>>> altogether.
>> That seems a somewhat extreme point of view.
> 
> Hey, I didn't design the language, I just use it. :)

I'm with Steve.  Multiple inheritance is still a "good" thing, especially for 
mixin-classes.  wxPython, for instance, wouldn't be nearly so flexible without it.

-Larry



More information about the Python-list mailing list