python定义接口继承类invalid syntax解决办法
1
2
3
4
5
6
7
|
class s_all(metaclass = abc.ABCMeta): #python2.7用此方法定义接口继承 # __metaclass__ = abc.ABCMeta @abc .abstractmethod def read( self ): pass |
pyhton2.7会报错,此方法用于python3+pyhton2.7应用次方法定义
1
2
3
4
5
6
7
|
class s_all(): #python2.7用此方法定义接口继承 __metaclass__ = abc.ABCMeta @abc .abstractmethod def read( self ): pass |