Does Python have Multiple Inheritance ?

Tim Golden mail at timgolden.me.uk
Fri Nov 7 10:38:22 EST 2008


Aaron Gray wrote:
> "Roy Smith" <roy at panix.com> wrote in message 
> news:roy-70E5DD.10065707112008 at news.panix.com...
>> In article <mailman.3639.1226069293.3487.python-list at python.org>,
>> Tim Golden <mail at timgolden.me.uk> wrote:
>>
>>> Aaron Gray wrote:
>>>> Wikipedia says Python has Multiple Inheritance, is this true ?
>>>>
>>>>     http://en.wikipedia.org/wiki/Multiple_inheritance
>>>>
>>>> Thanks,
>>>>
>>>> Aaron
>>> Good grief. You can use Wikipedia but you can't use Google?
>>>
>>> http://www.google.co.uk/search?q=python+multiple+inheritance
>>>
>>> TJG
>> Think of it this way:
>>
>> Aaron is-a WikipediaUser
>> Aaron is-a GoogleUser
>>
>> see, multiple inheritance!
> 
> See it this way Aaron is so damb supprised that there is another language 
> with MI and particularly that it is Python, all order and normal action go 
> out the window !

Glad you can see the funny side.

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. Certainly in my
own (not negligible) use of Python, I've very rarely used it for anything
but the occasional mixin class.

I'll leave others to comment on whether this is indeed so and why
it might be :)

TJG



More information about the Python-list mailing list