[Python-checkins] CVS: python/dist/src/Doc/ref ref3.tex,1.43,1.44

Fred L. Drake python-dev@python.org
Wed, 28 Jun 2000 13:15:52 -0700


Update of /cvsroot/python/python/dist/src/Doc/ref
In directory slayer.i.sourceforge.net:/tmp/cvs-serv26351/ref

Modified Files:
	ref3.tex 
Log Message:

Revise the description of when functions retrieved from class instances
are and are not turned into bound methods; some confusion was noted by
Andrew Dalke.

In particular, it has to be noted that functions located on the class
instance are not turned into any sort of method, only those which are
found via the underlying class.


Index: ref3.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref3.tex,v
retrieving revision 1.43
retrieving revision 1.44
diff -C2 -r1.43 -r1.44
*** ref3.tex	2000/06/15 20:07:25	1.43
--- ref3.tex	2000/06/28 20:15:47	1.44
***************
*** 439,447 ****
  User-defined method objects are created in two ways: when getting an
  attribute of a class that is a user-defined function object, or when
! getting an attributes of a class instance that is a user-defined
! function object.  In the former 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
--- 439,448 ----
  User-defined method objects are created in two ways: when getting an
  attribute of a class that is a user-defined function object, or when
! getting an attribute of a class instance that is a user-defined
! function object defined by the class of the instance.  In the former
! 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
***************
*** 453,459 ****
  \code{m.im_self} is \code{x}.
  \withsubitem{(method attribute)}{
!   \ttindex{im_class}
!   \ttindex{im_func}
!   \ttindex{im_self}}
  
  When an unbound user-defined method object is called, the underlying
--- 454,458 ----
  \code{m.im_self} is \code{x}.
  \withsubitem{(method attribute)}{
!   \ttindex{im_class}\ttindex{im_func}\ttindex{im_self}}
  
  When an unbound user-defined method object is called, the underlying
***************
*** 475,479 ****
  Also notice that this transformation only happens for user-defined
  functions; other callable objects (and all non-callable objects) are
! retrieved without transformation.
  
  \item[Built-in functions]
--- 474,481 ----
  Also notice that this transformation only happens for user-defined
  functions; other callable objects (and all non-callable objects) are
! retrieved without transformation.  It is also important to note that
! user-defined functions which are attributes of a class instance are
! not converted to bound methods; this \emph{only} happens when the
! function is an attribute of the class.
  
  \item[Built-in functions]