我正在研究一种lib,由于一个奇怪的原因,我有这个错误.
抱歉,无法复制并粘贴它
我的基础是下面的代码有效
test.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")
Run Code Online (Sandbox Code Playgroud)
在python shell中
>>> from test import *
>>> s = SubClass()
whatever
Run Code Online (Sandbox Code Playgroud)
为什么我的名册模块我有这个错误
Can't instantiate abstract class Player with abstract methods _Base__json_builder, _Base__xml_builder
Run Code Online (Sandbox Code Playgroud)
提前致谢