title: Is it impossible to pass a instance variable as default of a method keyword?
body: <p>This will not work:</p>
  <pre><code>class myClass:
  
      def __init__(self, name):
          self.name = name
  
      def methodA(self, name=self.name):
          print(f&quot;Hello {name}!&quot;)
  
  myInstance = myClass(&quot;Frank&quot;)
  </code></pre>
  <p>Because:</p>
  <pre><code>NameError: name 'self' is not defined
  </code></pre>
  <p>Questions</p>
  <ol>
  <li>Why is that? Is <code>self.name</code> not already defined at the initialization of the class?</li>
  <li>Is there a way to have <code>name</code> defined at initialization of a class instance while also being able to changing its value when calling specific methods at the same time? I don't want to always change its value with a separate line (e.g. like so: <code>myInstance.name = &quot;Peter&quot;</code>) before I call a method. And, I also don't want to be forced to pass it on using a keyword (e.g. like so: <code>def methodB(self, name=name_typed_when_calling_method)</code> every time I call a method that uses that variable.</li>
  </ol>