title: Different way to create an instance method object in Python
body: <p>The Python 3.x language reference described two ways to create a method object:</p>
  <blockquote>
  <p>User-defined method objects may be created when getting an attribute of a class (perhaps via an instance of that class), if that attribute is a user-defined function object or a class method object.</p>
  <p>When an instance method object is created by retrieving a user-defined function object from a class via one of its instances, its self attribute is the instance, and the method object is said to be bound. The new method’s func attribute is the original function object.</p>
  <p>When a user-defined method object is created by retrieving another method object from a class or instance, the behaviour is the same as for a function object, except that the func attribute of the new instance is not the original method object but its func attribute.</p>
  <p>When an instance method object is called, the underlying function (<strong>func</strong>) is called, inserting the class instance (<strong>self</strong>) in front of the argument list. For instance, when C is a class which contains a definition for a function f(), and x is an instance of C, calling x.f(1) is equivalent to calling C.f(x, 1).</p>
  <p>When an instance method object is derived from a class method object, the “class instance” stored in <strong>self</strong> will actually be the class itself, so that calling either x.f(1) or C.f(1) is equivalent to calling f(C,1) where f is the underlying function.</p>
  </blockquote>
  <p>In different ways, they both have different <code>__func__</code> and <code>__self__</code> values, but I'm not very aware of these two different ways, could someone explain it to me?</p>
  <p>Python Language Reference | The Standard Type Hierarchy:
  <a href="https://docs.python.org/3/reference/datamodel.html#the-standard-type-hierarchy" rel="nofollow noreferrer">https://docs.python.org/3/reference/datamodel.html#the-standard-type-hierarchy</a></p>