[Python-checkins] python/dist/src/Doc/lib libitertools.tex, 1.33, 1.34

rhettinger at users.sourceforge.net rhettinger at users.sourceforge.net
Fri Mar 11 23:17:32 CET 2005


Update of /cvsroot/python/python/dist/src/Doc/lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1726/Doc/lib

Modified Files:
	libitertools.tex 
Log Message:
Revised the itertools quantifier recipes to match the performance of the
new builtins.



Index: libitertools.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libitertools.tex,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- libitertools.tex	5 Dec 2004 09:25:48 -0000	1.33
+++ libitertools.tex	11 Mar 2005 22:17:29 -0000	1.34
@@ -461,26 +461,26 @@
     "Returns the nth item"
     return list(islice(iterable, n, n+1))
 
-def all(seq, pred=bool):
-    "Returns True if pred(x) is True for every element in the iterable"
+def all(seq, pred=None):
+    "Returns True if pred(x) is true for every element in the iterable"
     for elem in ifilterfalse(pred, seq):
         return False
     return True
 
-def any(seq, pred=bool):
-    "Returns True if pred(x) is True for at least one element in the iterable"
+def any(seq, pred=None):
+    "Returns True if pred(x) is true for at least one element in the iterable"
     for elem in ifilter(pred, seq):
         return True
     return False
 
-def no(seq, pred=bool):
-    "Returns True if pred(x) is False for every element in the iterable"
+def no(seq, pred=None):
+    "Returns True if pred(x) is false for every element in the iterable"
     for elem in ifilter(pred, seq):
         return False
     return True
 
-def quantify(seq, pred=bool):
-    "Count how many times the predicate is True in the sequence"
+def quantify(seq, pred=None):
+    "Count how many times the predicate is true in the sequence"
     return sum(imap(pred, seq))
 
 def padnone(seq):



More information about the Python-checkins mailing list