Does Python have Multiple Inheritance ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Aaron Gray

    Does Python have Multiple Inheritance ?

    Wikipedia says Python has Multiple Inheritance, is this true ?



    Thanks,

    Aaron


  • Christian Heimes

    #2
    Re: Does Python have Multiple Inheritance ?

    Aaron Gray wrote:
    Wikipedia says Python has Multiple Inheritance, is this true ?
    >
    http://en.wikipedia.org/wiki/Multiple_inheritance
    Yes

    Comment

    • Tim Golden

      #3
      Re: Does Python have Multiple Inheritance ?

      Aaron Gray wrote:
      Wikipedia says Python has Multiple Inheritance, is this true ?
      >

      >
      Thanks,
      >
      Aaron
      Good grief. You can use Wikipedia but you can't use Google?



      TJG

      Comment

      • Roy Smith

        #4
        Re: Does Python have Multiple Inheritance ?

        In article <mailman.3639.1 226069293.3487. python-list@python.org >,
        Tim Golden <mail@timgolden .me.ukwrote:
        Aaron Gray wrote:
        Wikipedia says Python has Multiple Inheritance, is this true ?



        Thanks,

        Aaron
        >
        Good grief. You can use Wikipedia but you can't use Google?
        >

        >
        TJG
        Think of it this way:

        Aaron is-a WikipediaUser
        Aaron is-a GoogleUser

        see, multiple inheritance!

        Comment

        • Michele Simionato

          #5
          Re: Does Python have Multiple Inheritance ?

          On Nov 7, 3:50 pm, Tim Golden <m...@timgolden .me.ukwrote:
          Aaron Gray wrote:
          Wikipedia says Python has Multiple Inheritance, is this true ?
          >>
          Thanks,
          >
          Aaron
          >
          Good grief. You can use Wikipedia but you can't use Google?
          >

          >
          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.

          Comment

          • Michele Simionato

            #6
            Re: Does Python have Multiple Inheritance ?

            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).

            Comment

            • Lawrence D'Oliveiro

              #7
              Re: Does Python have Multiple Inheritance ?

              In message
              <90d2b348-73b4-446d-9673-3de62927d146@d4 2g2000prb.googl egroups.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.

              Comment

              • Steve Holden

                #8
                Re: Does Python have Multiple Inheritance ?

                Lawrence D'Oliveiro wrote:
                In message
                <90d2b348-73b4-446d-9673-3de62927d146@d4 2g2000prb.googl egroups.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/

                Comment

                • Lawrence D'Oliveiro

                  #9
                  Re: Does Python have Multiple Inheritance ?

                  In message <mailman.3675.1 226101014.3487. python-list@python.org >, Steve
                  Holden wrote:
                  Lawrence D'Oliveiro wrote:
                  >
                  >In message
                  ><90d2b348-73b4-446d-9673-3de62927d146@d4 2g2000prb.googl egroups.com>,
                  >Michele Simionato wrote:
                  >>
                  >>On Nov 7, 4:38 pm, Tim Golden <m...@timgolden .me.ukwrote:
                  >>>
                  >>>Seriously, though, although Python does indeed support multiple
                  >>>inheritanc e, 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. :)

                  Comment

                  • Larry Bates

                    #10
                    Re: Does Python have Multiple Inheritance ?

                    Lawrence D'Oliveiro wrote:
                    In message <mailman.3675.1 226101014.3487. python-list@python.org >, Steve
                    Holden wrote:
                    >
                    >Lawrence D'Oliveiro wrote:
                    >>
                    >>In message
                    >><90d2b348-73b4-446d-9673-3de62927d146@d4 2g2000prb.googl egroups.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

                    Comment

                    • Lawrence D'Oliveiro

                      #11
                      Re: Does Python have Multiple Inheritance ?

                      In message <%lIRk.67026$vX 2.47488@bignews 6.bellsouth.net >, Larry Bates
                      wrote:
                      Lawrence D'Oliveiro wrote:
                      >
                      >In message <mailman.3675.1 226101014.3487. python-list@python.org >, Steve
                      >Holden wrote:
                      >>
                      >>Lawrence D'Oliveiro wrote:
                      >>>
                      >>>Not to mention duck typing, which does away with the need for
                      >>>inheritanc e 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.

                      Comment

                      Working...