title: Python 2.6: How to access base class descriptor field hidden by derived class?
body: <p>I have a descriptor storing data in host object's dictionary.
  And I have fields of this descriptor in class hierarchy with the same name:</p>
  
  <pre><code>class ADescriptor(object):
      def __init__(self, keyname='descr'):
          self.keyname = keyname
  
      def __get__(self, obj, objtype):
          return getattr(obj, self.keyname, 8192 )
  
      def __set__(self, obj, val):
          setattr(obj, self.keyname, val)
  
  class A(object):
      f = ADescriptor('keyA')
  
  class B(A):
      f = ADescriptor('keyB')
  
  b = B()
  b.f = 'b'
  print super(B,b).f
  super(B,b).f = 'a'
  </code></pre>
  
  <p>Last line doesn't work:
  super(B,b).f = 'a'</p>
  
  <p>Why get works and analogous set doesn't? 
  Can I set A's f in a more elegant way than A.<strong>dict</strong>['f'].<strong>set</strong>(b,'a')?</p>
  
  <hr>
  
  <p>Corrected:</p>
  
  <p>In a form given in my initial post A.f evaluates to keyname-named property of A (missing) or default 8192 - nothing to do with it. That's why I used A.<strong>dict</strong>['f'] - to exclude <strong>get</strong> call.
  Minor modification was required to let A.f be evaluated into needed ADescriptor instance:</p>
  
  <pre><code>def __get__(self, obj, objtype=None):
      if not obj:      #return descriptor itself if no bound object given
          return self
      return getattr(obj, self.keyname, 8192 )
  </code></pre>
  
  <p>In this case <code>A.f.__set__(b,'a')</code> works.
  But it's still ugly!
  @BiggAl offered property solution is not good for my needs - I would need to wrap all my descriptors in properies.</p>