-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

3
  • And are you using Python 2 or Python 3? The proposed duplicate only makes sense for Python 2 if I understand it correctly. Commented Jun 2, 2019 at 10:30
  • Yes @tripleee python 2.7 Commented Jun 2, 2019 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. Commented Jun 2, 2019 at 10:31

1 Answer 1

-1

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

super(Kern).__init__() 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.