There isn't really anything wrong with explicitly copying parameters into attributes. If you have too many parameters in the ctor, it is sometimes considered a code smell and maybe you should group these params into a fewer objects. Other times, it is necessary and there is nothing wrong with it. Anyway, doing it explicitly is the way to go.

However, since you are asking HOW it can be done (and not whether it should be done), then one solution is this:

    class A:
        def __init__(self, **kwargs):
            for key in kwargs:
              setattr(self, key, kwargs[key])

    a = A(l=1, d=2)
    a.l # will return 1
    a.d # will return 2