title: how to implement attribute pop in python
body: <p>In Python the dict object has a "pop" method which returns and removes a key from a dict, with an optional default if the key doesn't exist.</p>
  
  <p>What is the best way to do this for general object attributes?</p>
  
  <p>I'm thinking:</p>
  
  <pre><code>my_obj.__dict__.pop('key_name', default)
  </code></pre>
  
  <p>Should be a good option but I'm worried that directly muting the object's <strong>dict</strong> might have unintended side effects that I'm not aware of. Is there a better option?</p>