By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,587 Members | 1,632 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,587 IT Pros & Developers. It's quick & easy.

Does Python have Multiple Inheritance ?

P: n/a
Wikipedia says Python has Multiple Inheritance, is this true ?

http://en.wikipedia.org/wiki/Multiple_inheritance

Thanks,

Aaron
Nov 7 '08 #1
Share this Question
Share on Google+
10 Replies


P: n/a
Aaron Gray wrote:
Wikipedia says Python has Multiple Inheritance, is this true ?

http://en.wikipedia.org/wiki/Multiple_inheritance
Yes

Nov 7 '08 #2

P: n/a
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=pyt...le+inheritance

TJG
Nov 7 '08 #3

P: n/a
In article <ma**************************************@python.o rg>,
Tim Golden <ma**@timgolden.me.ukwrote:
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=pyt...le+inheritance

TJG
Think of it this way:

Aaron is-a WikipediaUser
Aaron is-a GoogleUser

see, multiple inheritance!
Nov 7 '08 #4

P: n/a
On Nov 7, 3:50*pm, Tim Golden <m...@timgolden.me.ukwrote:
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=pyt...le+inheritance

TJG
It seems the OP cannot even use Wikipedia. Between the links to the
page he cites
there is http://en.wikipedia.org/wiki/C3_linearization, which is the
way Multiple Inheritance is implemented in Python.
Nov 7 '08 #5

P: n/a
On Nov 7, 4:38*pm, Tim Golden <m...@timgolden.me.ukwrote:
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 :)
The reason is that in Python using composition is very easy, so there
is little need for MI
(which is a Good Thing).
Nov 7 '08 #6

P: n/a
In message
<90**********************************@d42g2000prb. googlegroups.com>,
Michele Simionato wrote:
On Nov 7, 4:38*pm, Tim Golden <m...@timgolden.me.ukwrote:
>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.
Nov 7 '08 #7

P: n/a
Lawrence D'Oliveiro wrote:
In message
<90**********************************@d42g2000prb. googlegroups.com>,
Michele Simionato wrote:
>On Nov 7, 4:38 pm, Tim Golden <m...@timgolden.me.ukwrote:
>>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.

regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/

Nov 7 '08 #8

P: n/a
In message <ma**************************************@python.o rg>, Steve
Holden wrote:
Lawrence D'Oliveiro wrote:
>In message
<90**********************************@d42g2000prb .googlegroups.com>,
Michele Simionato wrote:
>>On Nov 7, 4:38 pm, Tim Golden <m...@timgolden.me.ukwrote:

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. :)
Nov 8 '08 #9

P: n/a
Lawrence D'Oliveiro wrote:
In message <ma**************************************@python.o rg>, Steve
Holden wrote:
>Lawrence D'Oliveiro wrote:
>>In message
<90**********************************@d42g2000pr b.googlegroups.com>,
Michele Simionato wrote:

On Nov 7, 4:38 pm, Tim Golden <m...@timgolden.me.ukwrote:

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
Nov 9 '08 #10

P: n/a
In message <%l*******************@bignews6.bellsouth.net>, Larry Bates
wrote:
Lawrence D'Oliveiro wrote:
>In message <ma**************************************@python.o rg>, Steve
Holden wrote:
>>Lawrence D'Oliveiro wrote:

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.
Sure. But Python doesn't _force_ you to do things that way.
Nov 16 '08 #11

This discussion thread is closed

Replies have been disabled for this discussion.