廖雪峰Python学习笔记之多重继承

先mark一下代码,学习体会稍后补齐。

class Animal(object): pass
class Mammal(Animal): # 大类 pass
class Bird(Animal): pass
class Dog(Mammal): # 各种动物 pass
class Bat(Mammal): pass
class Parrot(Bird): pass
class Ostrich(Bird): pass
class Runnable(object): def run(self): print('Running...')
class Flyable(object): def fly(self): print('Flying...')
class Dog(Mammal,Runnable): pass
class Bat(Mammal,Flyable): pass
class Dog(Mammal,RunnableMixmin,CarnivorousMixin): pass
class MyTCPServer(TCPServer,ForkingMixin): pass
class MyUDPServer(UDPServer,ThreadingMixin): pass
class MyTCPServer(TCPServer,CoroutineMixin): pass

你可能感兴趣的:(廖雪峰Python学习笔记之多重继承)