title: What is the best way to do automatic attribute assignment in Python, and is it a good idea?
body: <p>Instead of writing code like this every time I define a class:</p>
  
  <pre><code>class Foo(object): 
       def __init__(self, a, b, c, d, e, f, g):
          self.a = a
          self.b = b
          self.c = c
          self.d = d
          self.e = e
          self.f = f
          self.g = g
  </code></pre>
  
  <p>I could use <a href="http://code.activestate.com/recipes/551763/" rel="noreferrer">this recipe for automatic attribute assignment</a>.</p>
  
  <pre><code>class Foo(object):
       @autoassign
       def __init__(self, a, b, c, d, e, f, g):
          pass
  </code></pre>
  
  <p><strong>Two questions</strong>:</p>
  
  <ol>
  <li>Are there drawbacks or pitfalls associated with this shortcut?</li>
  <li>Is there a better way to achieve similar convenience?</li>
  </ol>