title: Python: dynamically add attributes to new-style class/obj
body: <p>Can I dynamically add attributes to instances of a new-style class (one that derives from <code>object</code>)?</p>
  
  <p>Details:</p>
  
  <p>I'm working with an instance of sqlite3.Connection.  Simply extending the class isn't an option because I don't get the instance by calling a constructor; I get it by calling <code>sqlite3.connect()</code>.</p>
  
  <p>Building a wrapper doesn't save me much of the bulk for the code I'm writing.</p>
  
  <p>Python 2.7.1</p>
  
  <p><strong>Edit</strong></p>
  
  <p>Right answers all.  But I still am not reaching my goal; instances of sqlite3.Connection bar my attempts to set attributes in the following ways (as do instances of <code>object</code> itself).  I always get an AttributeError:</p>
  
  <pre><code>&gt; conn = sqlite3.connect([filepath])
  &gt; conn.a = 'foo'
  Traceback (most recent call last):
    File "&lt;pyshell#2&gt;", line 1, in &lt;module&gt;
      conn.a = 'foo'
  AttributeError: 'object' object has no attribute 'a'
  &gt; conn.__setattr__('a','foo')
  Traceback (most recent call last):
    File "&lt;pyshell#2&gt;", line 1, in &lt;module&gt;
      conn.__setattr__('a','foo')
  AttributeError: 'object' object has no attribute 'a'
  </code></pre>
  
  <p>Help?</p>