]> granicus.if.org Git - python/commitdiff
Correct the description of im_class. (Fred, this is changed in 2.2.
authorGuido van Rossum <guido@python.org>
Fri, 7 Dec 2001 22:03:18 +0000 (22:03 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 7 Dec 2001 22:03:18 +0000 (22:03 +0000)
Should this be labeled as changed?  How?)

Doc/lib/libinspect.tex
Doc/ref/ref3.tex

index 1283cdd0e3888a1b6f94992ab0dce1c96e5ccf7f..06ee6de0e8a3abe36b8f19f8e6b813d4fc614968 100644 (file)
@@ -39,7 +39,7 @@ you can expect to find the following special attributes:
   \hline
   \lineiii{method}{__doc__}{documentation string}
   \lineiii{}{__name__}{name with which this method was defined}
-  \lineiii{}{im_class}{class object in which this method belongs}
+  \lineiii{}{im_class}{class object that asked for this method}
   \lineiii{}{im_func}{function object containing implementation of method}
   \lineiii{}{im_self}{instance to which this method is bound, or \code{None}}
   \hline
index 778b54fc2fa4de0159293f6bfbf66828bd8cfd14..b6a2df3b8b7ca948a39880609ac9a79c04c1eabd 100644 (file)
@@ -447,8 +447,8 @@ function).
 
 Special read-only attributes: \member{im_self} is the class instance
 object, \member{im_func} is the function object;
-\member{im_class} is the class that defined the method (which may be a
-base class of the class of which \member{im_self} is an instance);
+\member{im_class} is the class of \member{im_self} for bound methods,
+or the class that asked for the method for unbound methods);
 \member{__doc__} is the method's documentation (same as
 \code{im_func.__doc__}); \member{__name__} is the method name (same as
 \code{im_func.__name__}).
@@ -467,8 +467,8 @@ case (class attribute), the \member{im_self} attribute is \code{None},
 and the method object is said to be unbound; in the latter case
 (instance attribute), \method{im_self} is the instance, and the method
 object is said to be bound.  For
-instance, when \class{C} is a class which contains a definition for a
-function \method{f()}, \code{C.f} does not yield the function object
+instance, when \class{C} is a class which has a method
+\method{f()}, \code{C.f} does not yield the function object
 \code{f}; rather, it yields an unbound method object \code{m} where
 \code{m.im_class} is \class{C}, \code{m.im_func} is \method{f()}, and
 \code{m.im_self} is \code{None}.  When \code{x} is a \class{C}
@@ -597,7 +597,6 @@ base class list.
 When a class attribute reference would yield a user-defined function
 object, it is transformed into an unbound user-defined method object
 (see above).  The \member{im_class} attribute of this method object is the
-class in which the function object was found, not necessarily the
 class for which the attribute reference was initiated.
 \obindex{class}
 \obindex{class instance}
@@ -639,7 +638,7 @@ the search continues with the class attributes.  If a class attribute
 is found that is a user-defined function object (and in no other
 case), it is transformed into an unbound user-defined method object
 (see above).  The \member{im_class} attribute of this method object is
-the class in which the function object was found, not necessarily the
+the
 class of the instance for which the attribute reference was initiated.
 If no class attribute is found, and the object's class has a
 \method{__getattr__()} method, that is called to satisfy the lookup.