title: Python method be aware the self.variable changed
body: <p>I want to make a class function be aware of the self.var whether it is changed by its inherent child class. Like class C1 is the P's child class, and it changes the var's value, the func does A. When the "var" is not changed, like C2, then do B.</p>
  
  <pre><code>class P(object):
      var =  "original"
  
      def func(self):
          if # self.var is changed by child instance:
              do A
          else:
              do B
  
  class C1(P):
      var = "changed"
  
  class C2(P):
      pass
  
  c1 = C1
  c2 = C2
  
  c1.func() # do B
  c2.func() # do A
  </code></pre>
  
  <p>For the reason I am doing this and more complex explanation.</p>
  
  <p>I need to revise the openstack horizon <a href="https://github.com/openstack/horizon/blob/master/horizon/tabs/base.py" rel="nofollow">code</a> to fullfill my own function:</p>
  
  <pre><code>class TabGroup(html.HTMLElement):
      ......
      template_name = "horizon/common/_tab_group.html"
      ......
      def render(self):
          return render_to_string(self.template_name, {"tab_group": self})
  </code></pre>
  
  <p>The TabGroup is usually inherited by other children, And some of them change template_name, some of them not. I want the render method be aware of template_name if it is changed by its child, and do different render accordingly.</p>