**kwargs in class defenition. Error : " __init__() takes exactly 1 argument (2 given)"

Viewed 1180
class Test_class(object):
    def __init__(self,**kwargs):
        for a in kwargs.values():
            print a

dic = {"a_list":1}

Test_class(dic)

Hello Everybody, I am trying to understand what's wrong with the code. I am getting the following error:

__init__() takes exactly 1 argument (2 given)

Can anybody explain, please?

Cheers

3 Answers
Related