@@ -438,11 +438,12 @@ \section{The standard type hierarchy\label{types}}
438438
439439User-defined method objects are created in two ways: when getting an
440440attribute of a class that is a user-defined function object, or when
441- getting an attributes of a class instance that is a user-defined
442- function object. In the former case (class attribute), the
443- \member {im_self} attribute is \code {None}, and the method object is said
444- to be unbound; in the latter case (instance attribute), \method {im_self}
445- is the instance, and the method object is said to be bound. For
441+ getting an attribute of a class instance that is a user-defined
442+ function object defined by the class of the instance. In the former
443+ case (class attribute), the \member {im_self} attribute is \code {None},
444+ and the method object is said to be unbound; in the latter case
445+ (instance attribute), \method {im_self} is the instance, and the method
446+ object is said to be bound. For
446447instance, when \class {C} is a class which contains a definition for a
447448function \method {f()}, \code {C.f} does not yield the function object
448449\code {f}; rather, it yields an unbound method object \code {m} where
@@ -452,9 +453,7 @@ \section{The standard type hierarchy\label{types}}
452453\code {m.im_class} is \code {C}, \code {m.im_func} is \method {f()}, and
453454\code {m.im_self} is \code {x}.
454455\withsubitem {(method attribute)}{
455- \ttindex {im_class}
456- \ttindex {im_func}
457- \ttindex {im_self}}
456+ \ttindex {im_class}\ttindex {im_func}\ttindex {im_self}}
458457
459458When an unbound user-defined method object is called, the underlying
460459function (\member {im_func}) is called, with the restriction that the
@@ -474,7 +473,10 @@ \section{The standard type hierarchy\label{types}}
474473assign the attribute to a local variable and call that local variable.
475474Also notice that this transformation only happens for user-defined
476475functions; other callable objects (and all non-callable objects) are
477- retrieved without transformation.
476+ retrieved without transformation. It is also important to note that
477+ user-defined functions which are attributes of a class instance are
478+ not converted to bound methods; this \emph {only } happens when the
479+ function is an attribute of the class.
478480
479481\item [Built-in functions]
480482A built-in function object is a wrapper around a \C {} function. Examples
0 commit comments