我正在尝试通过类方法继承aiml内核
import aiml
class Kern(aiml.Kernel):
def __init__(self):
super(Kern, self).__init__(self)
k = Kern()
aiml.Kernel是一个类,但是当我尝试实例化Kern继承的超类时,仍然出现以下错误
super(Kern, self).__init__(self)
TypeError: must be type, not classobj
请让我知道发生了什么错误
答案 0 :(得分:-1)
super
不接受self
作为参数。删除行中的两个self
。以下应该可以正常工作
super(Kern).__init__()