Passing kwargs raises error

So I wrote something like this in some production code and expected it to work,
note that this isn’t the actual production code, but just a representative.

class Digital:
    def __init__(self,**args):
        if args:
            self.acts(args)

    def acts(self,**kwargs):
        print(kwargs)       #Let's just go with this for the sake of the example.

Now on instantiating the class with some key word arguments, a TypeError is raised saying that the function can only take in 1 positional argument but 2 were given.
This doesn’t occur for any other type of arguments except dictionaries and keyword args.
Someone with more expertise about this, please help.

Hi Tobias,
you didn’t use the packet operator to pass arguments into the acts method.

class Digital:

    def __init__(self, **kwargs):
        if kwargs:
            self.acts(**kwargs)

    def acts(self, **kwargs):
        print(kwargs)

Also, I recommend that you always use the kwargs variable for keyword arguments, otherwise you get confused.
Hello

:sweat_smile: :sweat_smile: Thanks @matteoguadrini . I don’t know why I always forget the simple stuff like this.