我正在研究一种库,出于一个奇怪的原因,我遇到了这个错误。
抱歉不能直接复制粘贴
我的基础是下面的代码有效
测试.py
import abc
import six
@six.add_metaclass(abc.ABCMeta)
class Base(object):
@abc.abstractmethod
def whatever(self,):
raise NotImplementedError
class SubClass(Base):
def __init__(self,):
super(Base, self).__init__()
self.whatever()
def whatever(self,):
print("whatever")
在 python 外壳中
>>> from test import *
>>> s = SubClass()
whatever
为什么我的名册模块出现此错误
Can't instantiate abstract class Player with abstract methods _Base__json_builder, _Base__xml_builder
提前致谢