import abc
class AbsClass(metaclass=abc.ABCMeta):
@abc.abstractclassmethod
def fun1(self):
pass
@abc.abstractclassmethod
def fun2(self):
pass
class obj1(AbsClass):
def fun1(self):
pass
def fun2(self):
pass
class obj2(AbsClass):
pass
a=obj1()
原文地址:http://blog.51cto.com/13606158/2085630