I have a python class with several init variables:

```
class Foo(object):
    def __init__(self, d1, d2):
        self.d1 = d1
        self.d2 = d2

```

Is there a way to create this code automatically in PyCharm, so I don't have to type explicitly:

```
self.dn = dn

```

This pattern happens very often in my code. Is there a better (Pythonic) way to initialize classes?

I have already seen this post ( [What is the best way to do automatic attribute assignment in Python, and is it a good idea?](https://stackoverflow.com/questions/3652851/what-is-the-best-way-to-do-automatic-attribute-assignment-in-python-and-is-it-a)), but I don't want to use a decorator as it makes the code less readable.