Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (19.9k points)

I get this error:

TypeError: object.__init__() takes no parameters 

when running my code, I don't really see what I'm doing wrong here though:

class IRCReplyModule(object):

    activated=True

    moduleHandlerResultList=None

    moduleHandlerCommandlist=None

    modulename=""

    def __init__(self,modulename):

        self.modulename = modulename

class SimpleHelloWorld(IRCReplyModule):

     def __init__(self):

            super(IRCReplyModule,self).__init__('hello world')

1 Answer

0 votes
by (25.1k points)

You are calling the wrong class name in your super() call:

class SimpleHelloWorld(IRCReplyModule):

     def __init__(self):

            #super(IRCReplyModule,self).__init__('hello world')

            super(SimpleHelloWorld,self).__init__('hello world')

If you want to get a deeper understanding of python you can watch this youtube video: 

Related questions

Browse Categories

...