title: Is there a generic way for a function to reference itself?
body: <p>I can access a python function's attribute inside of function itself by below code:</p>
  
  <pre><code>def aa():
      print aa.__name__
      print aa.__hash__
      # other simliar
  </code></pre>
  
  <p>However, if above <code>aa()</code> function is a template for write other code, say <code>bb()</code>, I have to write:</p>
  
  <pre><code>def bb():
      print bb.__name__
      print bb.__hash__
      # other simliar
  </code></pre>
  
  <p>Is there a "pointer" similar to the <code>self</code> argument in a class method so I could write code like this?</p>
  
  <pre><code>def whatever():
      print self.__name__
      print self.__hash__
      # other simliar
  </code></pre>
  
  <p>I searched and found someone said to use the class to solve this problem, but that may be a trouble to redefine all the existing functions. Any suggestions?</p>