title: Python subclassing - how to update class attribute that is used by another class attribute
body: <p>Say if there's a class attribute that is calculated depending on another class attribute:</p>
  
  <pre><code>class ClassA(object):
      attr1=5
      attr2=attr1+10
  
  &gt;&gt;ClassA.attr2
  15
  </code></pre>
  
  <p>And then in a child class I want to update the first class attribute to cause a change in the second one, without re-defining the second. e.g:</p>
  
  <pre><code>class ClassB(ClassA):
      attr1=10
  </code></pre>
  
  <p>What I would like to happen is:</p>
  
  <pre><code>&gt;&gt;ClassB.attr2
  20
  </code></pre>
  
  <p>However this isn't the case since attr2 gets calculated before attr1 is re-defined. Is there a way to obtain this behaviour without redefining the second attribute?</p>
  
  <p>(My particular use case is defining WTForms with Field attributes (format, choices, etc) that are derived from the Form class attributes, so I can subclass a base Form and change these attributes without having to re-define the entire Field.)</p>