title: Python member variable as parameter
body: <p>I have a class <code>A</code> with a member function <code>a</code> and a parameter <code>p</code> with a default value. I want this default value to be the member variable of the class.</p>
  
  <pre><code>class A:
     def a(self, p = self.b):
         print p
  </code></pre>
  
  <p>However it crashed with the information:</p>
  
  <pre><code>&lt;ipython-input-2-a0639d7525d3&gt; in A()
        1 class A:
  ----&gt; 2     def a(self, p = self.b):
        3         print p
        4
  
  NameError: name 'self' is not defined
  </code></pre>
  
  <p>I want to know whether I can pass a member variable as a default parameter to the member function?</p>