[Python-checkins] python/dist/src/Doc/ref ref3.tex,1.102,1.103
fdrake@users.sourceforge.net
fdrake@users.sourceforge.net
Mon, 12 May 2003 06:50:14 -0700
Update of /cvsroot/python/python/dist/src/Doc/ref
In directory sc8-pr-cvs1:/tmp/cvs-serv8132
Modified Files:
ref3.tex
Log Message:
Add a specific mention of the term "operator overloading" and add an
index entry. Suggested to python-docs.
Index: ref3.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref3.tex,v
retrieving revision 1.102
retrieving revision 1.103
diff -C2 -d -r1.102 -r1.103
*** ref3.tex 20 Mar 2003 18:17:16 -0000 1.102
--- ref3.tex 12 May 2003 13:50:11 -0000 1.103
***************
*** 940,944 ****
A class can implement certain operations that are invoked by special
syntax (such as arithmetic operations or subscripting and slicing) by
! defining methods with special names. For instance, if a class defines
a method named \method{__getitem__()}, and \code{x} is an instance of
this class, then \code{x[i]} is equivalent to
--- 940,947 ----
A class can implement certain operations that are invoked by special
syntax (such as arithmetic operations or subscripting and slicing) by
! defining methods with special names.\indexii{operator}{overloading}
! This is Python's approach to \dfn{operator overloading}, allowing
! classes to define their own behavior with respect to language
! operators. For instance, if a class defines
a method named \method{__getitem__()}, and \code{x} is an instance of
this class, then \code{x[i]} is equivalent to