在python 2.7中继承aiml

时间:2019-06-02 10:16:23

标签: python python-2.7 oop aiml

我正在尝试通过类方法继承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

请让我知道发生了什么错误

1 个答案:

答案 0 :(得分:-1)

super不接受self作为参数。删除行中的两个self。以下应该可以正常工作

super(Kern).__init__()