title: Using descriptor to access variable instead of binding this variable with the target in the instance
body: <p>I have just been reading <a href="https://github.com/FSX/momoko/blob/master/docs/tutorial.rst" rel="nofollow"><code>momoko</code> docs</a>, and came across the following class:</p>
  
  <pre><code>class BaseHandler(RequestHandler):
      @property
      def db(self):
          return self.application.db
  </code></pre>
  
  <p>Every time we want to access <code>db</code> attribute of <code>base_handler</code> instance of <code>BaseHandler</code>, the <code>db(self)</code> will be called, returning <code>self.application.db</code>.</p>
  
  <p>What is the advantage of this code over the following?</p>
  
  <pre><code>class BaseHandler(RequestHandler):
      def __init__(self):
          self.db = self.application.db
  </code></pre>
  
  <p>This will bind instance variable <code>db</code> to <code>self.application.db</code>. </p>
  
  <p>I understand that the former approach will avoid us of having <code>self.db</code> in each instance. On the other hand, <code>self.application.db</code> has extra attribute resolution step (extra <code>.</code>).</p>
  
  <p>Are there any advantages of the former approach that I don't see?</p>