title: Why can instance methods be called as class methods in Python 3?
body: <p>Consider the following class:</p>
  
  <pre><code>class Foo(object):
      def bar(self):
          print(self)
  </code></pre>
  
  <p><strong>In Python 2</strong> (2.7.13), calling <code>bar()</code> as a class method raises an exception:</p>
  
  <pre><code>&gt;&gt;&gt; Foo.bar('hello')
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  TypeError: unbound method bar() must be called with Foo instance as first argument (got str instance instead)
  
  &gt;&gt;&gt; Foo.bar()
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  TypeError: unbound method bar() must be called with Foo instance as first argument (got nothing instead)
  </code></pre>
  
  <p>When <code>bar()</code> is called as an instance method it recognizes <code>self</code> as the instance when called without arguments</p>
  
  <pre><code>&gt;&gt;&gt; Foo().bar('hello')
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  TypeError: bar() takes exactly 1 argument (2 given)
  
  &gt;&gt;&gt; Foo().bar()
  &lt;__main__.Foo object at 0x10a8e1a10&gt;
  </code></pre>
  
  <p><strong>In Python 3</strong> (3.6.0), when calling <code>bar()</code> as a class method, the first argument is accepted as <code>self</code>:</p>
  
  <pre><code>&gt;&gt;&gt; Foo.bar('hello')
  hello
  
  &gt;&gt;&gt; Foo.bar()
   Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  TypeError: bar() missing 1 required positional argument: 'self'
  </code></pre>
  
  <p>Calling <code>bar()</code> as an instance method works as in Python 2</p>
  
  <pre><code>&gt;&gt;&gt; Foo().bar('hello')
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  TypeError: bar() takes 1 positional argument but 2 were given
  
  &gt;&gt;&gt; Foo().bar()
  &lt;__main__.Foo object at 0x104ab34a8&gt;
  </code></pre>