[Python-checkins] python/dist/src/Doc/lib libitertools.tex, 1.18, 1.19

gvanrossum at users.sourceforge.net gvanrossum at users.sourceforge.net
Mon Oct 20 13:01:10 EDT 2003


Update of /cvsroot/python/python/dist/src/Doc/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv16118
Modified Files:
	libitertools.tex 
Log Message:
Use 'predicate = bool' as the default predicate for ifilter[false].
Index: libitertools.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libitertools.tex,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** libitertools.tex	5 Oct 2003 16:47:36 -0000	1.18
--- libitertools.tex	20 Oct 2003 17:01:07 -0000	1.19
***************
*** 141,146 ****
 def ifilter(predicate, iterable):
 if predicate is None:
! def predicate(x):
! return x
 for x in iterable:
 if predicate(x):
--- 141,145 ----
 def ifilter(predicate, iterable):
 if predicate is None:
! predicate = bool
 for x in iterable:
 if predicate(x):
***************
*** 158,163 ****
 def ifilterfalse(predicate, iterable):
 if predicate is None:
! def predicate(x):
! return x
 for x in iterable:
 if not predicate(x):
--- 157,161 ----
 def ifilterfalse(predicate, iterable):
 if predicate is None:
! predicate = bool
 for x in iterable:
 if not predicate(x):


More information about the Python-checkins mailing list

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