title: Python property setter/getter reference
body: <p>I have a class where I have to give back a callback function in the <strong>iter</strong> function.
  With attributes and get_... style it is easy:</p>
  
  <pre><code>class Test(object):
      def __init__(self):
          self.attrib = 'bla'
  
      def get_attrib(self):
          return self.attrib
  
      def __iter__(self):
          yield ('attrib',self.get_attrib)
  
      def __str__(self):
          ret = ''
          for one in self:
              ret += '%s: %s\n'%(one[0],one[1]())
          return ret
  
  print(Test())
  </code></pre>
  
  <p>I would like to be more pythonic and use properties. But how can I do the same with the getter of the propertyr? Because this does not work:</p>
  
  <pre><code>class Test(object):
      def __init__(self):
          self._prop = 'bla'
  
      @property
      def prop(self):
          return self._prop
  
      def __iter__(self):
          yield ('prop',self.prop.__get__)
  
      def __str__(self):
          ret = ''
          for one in self:
              ret += '%s: %s\n'%(one[0],one[1]())
          return ret
  
  print(Test())
  </code></pre>
  
  <p>I found the following but it requires the object itself as an argument when I call it:</p>
  
  <pre><code>def __iter__(self):
          yield ('prop',self.__class__.prop.__get__)
  
  a = Test()
  for one in a:
      print '%s: %s'%(one[0],one[1](a)
  </code></pre>
  
  <p><strong>UPDATE</strong>: I need the setter as well but I wanted to make the example simple enough. So at the end I would like to have something like:</p>
  
  <pre><code>def __iter__(self):
              yield ('prop',self.prop.__get__,self.prop.__set__)
  </code></pre>