title: method objects vs function objects , Python class instances vs class
body: <p>I am trying to verify the difference between instance attributes and class attributes as laid out by the Python tutorial release 2.7.3 dated Nov 01, 2012, chapter 9: Classes, Page 66 last line (<a href="https://docs.python.org/2/tutorial/classes.html#instance-objects"><em>source</em></a>):</p>
  
  <blockquote>
    <p>Valid method names of an instance object depend on its class. By
    definition, all attributes of a class that are function objects define
    corresponding methods of its instances. So in our example, x.f is a
    valid method reference, since MyClass.f is a function, but x.i is not,
    since MyClass.i is not. <strong>But x.f is not the same thing as MyClass.f —
    it is a method object, not a function object.</strong></p>
  </blockquote>
  
  <p>I have this:</p>
  
  <pre><code>class MyClass:    
     """A simple example class"""    
     i = 12345   
     def f():    
        return 'hello world'
  </code></pre>
  
  <p>Then I do this:</p>
  
  <pre><code>&gt;&gt;&gt; x = MyClass()
  &gt;&gt;&gt; x.f
  &lt;bound method MyClass.f of &lt;__main__.MyClass instance at 0x02BB8968&gt;&gt;
  &gt;&gt;&gt; MyClass.f
  &lt;unbound method MyClass.f&gt;
  &gt;&gt;&gt; type(MyClass.f)
  &lt;type 'instancemethod'&gt;
  &gt;&gt;&gt; type(x.f)
  &lt;type 'instancemethod'&gt;
  </code></pre>
  
  <p>Note that the type of both <code>x.f</code> and <code>MyClass.f</code> is  instancemethod. There is no difference in types but the tutorial says otherwise. Can someone please clarify?</p>