title: How to automatically add attributes to a class in python?
body: <p>I have a class with quite a few attributes that are provided when instanciating (<strong>init</strong>).</p>
  
  <p>Looks like this, but with about 30 more attr:</p>
  
  <pre><code>class SomeObject:
      def __init__(self,
                   first,
                   second):
          self.first = first
          self.second = second
  </code></pre>
  
  <p>Works fine, but gets very long an repetitive and hard to update.</p>
  
  <p>Before I used a much smaller class:</p>
  
  <pre><code>class SomeObject:
      def __init__(self, **attr):
          self.__dict__.update(attr)
  </code></pre>
  
  <p>Works fine, much easier, but hard to keep track. When using an IDE (I use PyCharm) I will have no hints when writing an object and autocomplete hints are usually not working.</p>
  
  <p>I would look for some mix of both classes, like:</p>
  
  <pre><code>class SomeObject:
      def __init__(self,
                   first,
                   second):
      self.__dict__.update(???)  # I would like to do it in a single line, so I dont have to write a new attr two (three...) times.
  </code></pre>
  
  <p>Anybody knows if / how this is possible? Thanks a lot</p>
  
  <p>Python 3.4 +
  PyCharm 2016.1 CommunityEdition</p>
  
  <p>... Edit / Additional ...</p>
  
  <p>The problem seems to be primarily to "preserve" the code inspection in the IDE, so that the autocompletion etc. is still available on the object.</p>