title: How to assign a new class attribute via __dict__?
body: <p>I want to assign a class attribute via a string object - but how?</p>
  
  <p>Example:</p>
  
  <pre><code>class test(object):
    pass
  
  a = test()
  test.value = 5
  a.value
  # -&gt; 5
  test.__dict__['value']
  # -&gt; 5
  
  # BUT:
  attr_name = 'next_value'
  
  test.__dict__[attr_name] = 10
  # -&gt; 'dictproxy' object does not support item assignment
  </code></pre>