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

Thomas Wouters python-dev@python.org
Mon, 11 Dec 2000 15:11:56 -0800


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

Modified Files:
	ref3.tex 
Log Message:

Additional docs for __iadd__ and family, closing SF bug #117178 and SF patch
#102169.



Index: ref3.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref3.tex,v
retrieving revision 1.53
retrieving revision 1.54
diff -C2 -r1.53 -r1.54
*** ref3.tex	2000/12/07 04:49:34	1.53
--- ref3.tex	2000/12/11 23:11:51	1.54
***************
*** 1294,1297 ****
--- 1294,1323 ----
  \end{methoddesc}
  
+ \begin{methoddesc}[numeric object]{__iadd__}{self, other}
+ \methodline[numeric object]{__isub__}{self, other}
+ \methodline[numeric object]{__imul__}{self, other}
+ \methodline[numeric object]{__idiv__}{self, other}
+ \methodline[numeric object]{__imod__}{self, other}
+ \methodline[numeric object]{__ipow__}{self, other\optional{, modulo}}
+ \methodline[numeric object]{__ilshift__}{self, other}
+ \methodline[numeric object]{__irshift__}{self, other}
+ \methodline[numeric object]{__iand__}{self, other}
+ \methodline[numeric object]{__ixor__}{self, other}
+ \methodline[numeric object]{__ior__}{self, other}
+ These methods are called to implement the augmented arithmetic operations
+ (\code{+=}, \code{-=}, \code{*=}, \code{/=}, \code{\%=}, \code{**=},
+ \code{<<=}, \code{>>=}, \code{\&=}, \code{\^=}, \code{|=}).  These methods
+ should attempt to do the operation in-place (modifying \var{self}) and
+ return the result (which could be, but does not have to be, \var{self}).  If
+ a specific method is not defined, the augmented operation falls back to the
+ normal methods.  For instance, to evaluate the expression
+ \var{x}\code{+=}\var{y}, where \var{x} is an instance of a class that has an
+ \method{__iadd__()} method, \code{\var{x}.__iadd__(\var{y})} is called.  If
+ \var{x} is an instance of a class that does not define a \method{__iadd()}
+ method, \code{\var{x}.__add__(\var{y})} and \code{\var{y}.__radd__(\var{x})}
+ are considered, as with the evaluation of \var{x}\code{+}\var{y}.
+ 
+ \end{methoddesc}
+ 
  \begin{methoddesc}[numeric object]{__neg__}{self}
  \methodline[numeric object]{__pos__}{self}