title: What is the purpose of the `self` parameter? Why is it needed?
body: <p>Consider this example:</p>
  <pre class="lang-py prettyprint-override"><code>class MyClass:
      def func(self, name):
          self.name = name
  </code></pre>
  <p>I know that <code>self</code> refers to the specific instance of <code>MyClass</code>. But why must <code>func</code> explicitly include <code>self</code> as a parameter? Why do we need to use <code>self</code> in the method's code? Some other languages make this implicit, or use special syntax instead.</p>
  <hr />
  <p><sub>For a <em>language-agnostic</em> consideration of the design decision, see <a href="https://stackoverflow.com/questions/910020/">What is the advantage of having this/self pointer mandatory explicit?</a>.</sub></p>
  <p><sub>To close <em>debugging questions</em> where OP omitted a <code>self</code> parameter for a method and got a <code>TypeError</code>, use <a href="https://stackoverflow.com/questions/23944657">TypeError: method() takes 1 positional argument but 2 were given</a> instead. If OP omitted <code>self.</code> in the body of the method and got a <code>NameError</code>, consider <a href="https://stackoverflow.com/questions/5615648">How can I call a function within a class?</a>.</sub></p>