[Python-checkins] python/dist/src/Doc/lib libfuncs.tex,1.132,1.133

loewis@users.sourceforge.net loewis@users.sourceforge.net
2003年5月31日 01:02:40 -0700


Update of /cvsroot/python/python/dist/src/Doc/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv850
Modified Files:
	libfuncs.tex 
Log Message:
Patch #744877: Explain filter in terms of list comprehension. Remove
explanation of int in terms of string.atoi. Explain sum in terms of
reduce.
Index: libfuncs.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libfuncs.tex,v
retrieving revision 1.132
retrieving revision 1.133
diff -C2 -d -r1.132 -r1.133
*** libfuncs.tex	10 May 2003 19:46:39 -0000	1.132
--- libfuncs.tex	31 May 2003 08:02:38 -0000	1.133
***************
*** 440,443 ****
--- 440,448 ----
 function is assumed, that is, all elements of \var{list} that are false
 (zero or empty) are removed.
+ 
+ Note that \code{filter(function, list)} equals
+ \code{[item for item in list if function(item)]} if function is not
+ \code{None} and \code{[item for item in list if item]} if function is
+ None.
 \end{funcdesc}
 
***************
*** 538,544 ****
 Convert a string or number to a plain integer. If the argument is a
 string, it must contain a possibly signed decimal number
! representable as a Python integer, possibly embedded in whitespace;
! this behaves identical to \code{string.atoi(\var{x}\optional{,
! \var{radix}})}. The \var{radix} parameter gives the base for the
 conversion and may be any integer in the range [2, 36], or zero. If
 \var{radix} is zero, the proper radix is guessed based on the
--- 543,548 ----
 Convert a string or number to a plain integer. If the argument is a
 string, it must contain a possibly signed decimal number
! representable as a Python integer, possibly embedded in whitespace.
! The \var{radix} parameter gives the base for the
 conversion and may be any integer in the range [2, 36], or zero. If
 \var{radix} is zero, the proper radix is guessed based on the
***************
*** 905,908 ****
--- 909,913 ----
 to be strings. The fast, correct way to concatenate sequence of
 strings is by calling \code{''.join(\var{sequence})}.
+ Note that \code{sum(range(n), m)} equals \code{reduce(operator.add, range(n), m)}
 \versionadded{2.3}
 \end{funcdesc}

AltStyle によって変換されたページ (->オリジナル) /