-1

I am trying to inherit aiml kernel through class approach

import aiml

class Kern(aiml.Kernel):
    def __init__(self):
       super(Kern, self).__init__(self)

k = Kern()

aiml.Kernel is a class but still I am getting the below error when I am trying to instantiate the super class from which Kern has inherited

super(Kern, self).__init__(self)
TypeError: must be type, not classobj

Please let me know what is the mistake that am making

tripleee
  • 175,061
  • 34
  • 275
  • 318
Tahseen
  • 1,027
  • 1
  • 12
  • 32
  • And are you using Python 2 or Python 3? The proposed duplicate only makes sense for Python 2 if I understand it correctly. – tripleee Jun 02 '19 at 10:30
  • Yes @tripleee python 2.7 – Tahseen Jun 02 '19 at 10:31
  • Unless you are forced by external factors, you should probably ignore Python 2, and spend your time on the currently recommended and supported version of the language, which is Python 3. – tripleee Jun 02 '19 at 10:31

1 Answers1

-1

super does not accept self as argument. Get rid of both self in the line. Following shall work fine

super(Kern).__init__()
Neel
  • 360
  • 1
  • 10