summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2003-10-05 16:47:36 (GMT)
committerRaymond Hettinger <python@rcn.com>2003-10-05 16:47:36 (GMT)
commitdbe3d280e70c8a2a5542839a118333d645192b79 (patch)
tree220b97aec9f8b56de7fd4ffa1013514efb6094fc /Doc
parent2f726e9093381572b21edbfc42659ea89fbdf686 (diff)
downloadcpython-dbe3d280e70c8a2a5542839a118333d645192b79.zip
cpython-dbe3d280e70c8a2a5542839a118333d645192b79.tar.gz
cpython-dbe3d280e70c8a2a5542839a118333d645192b79.tar.bz2
Adopt Christian Stork's suggested argument order for the logic quantifiers.
Adopt Jeremy Fincher's suggested function name, "any", instead of "some".
Diffstat (limited to 'Doc')
-rw-r--r--Doc/lib/libitertools.tex8
1 files changed, 4 insertions, 4 deletions
diff --git a/Doc/lib/libitertools.tex b/Doc/lib/libitertools.tex
index 3b70546..30d80c1 100644
--- a/Doc/lib/libitertools.tex
+++ b/Doc/lib/libitertools.tex
@@ -344,19 +344,19 @@ def nth(iterable, n):
"Returns the nth item"
return list(islice(iterable, n, n+1))
-def all(pred, seq):
+def all(seq, pred=bool):
"Returns True if pred(x) is True for every element in the iterable"
return False not in imap(pred, seq)
-def some(pred, seq):
+def any(seq, pred=bool):
"Returns True if pred(x) is True at least one element in the iterable"
return True in imap(pred, seq)
-def no(pred, seq):
+def no(seq, pred=bool):
"Returns True if pred(x) is False for every element in the iterable"
return True not in imap(pred, seq)
-def quantify(pred, seq):
+def quantify(seq, pred=bool):
"Count how many times the predicate is True in the sequence"
return sum(imap(pred, seq))