1.1 Multiple Inheritance
>>> # Max class
... class Animal (object):
... pass
...
>>> # Big class
... class mammal (Animal):
... pass
...
>>> class Bird (Animal):
... pass
...
>>> class Runnable (object):
... def run (self):
... print (' Running ... ')
...
>>> Classdog (mammal, Runnable):-- inherit mammal, Runnable two functions of a parent class
... pass
...
>>> s = Dog ()
>>> S.run ()
Running ...
Mixln
in the design of the inheritance of the class, usually, the main line is a single inheritance, but multiple inheritance, in order to better see the relationship between multiple inheritance, plus Mixln.
>>> Classdog (mammal, RUNNABLEMIXLN, xxxxmixln ...):
... pass
...
This article is from the "90SirDB" blog, be sure to keep this source http://90sirdb.blog.51cto.com/8713279/1826209
Python Advanced Object-oriented programming-Multiple inheritance