summaryrefslogtreecommitdiffstats
path: root/Doc/lib/libitertools.tex
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2003-07-22 06:33:13 (GMT)
committerRaymond Hettinger <python@rcn.com>2003-07-22 06:33:13 (GMT)
commit88821f7c2020eccd8c41cf1926be465abda7a1c4 (patch)
treeaf14207316ac26cd8f7771090c6cb663d4a79e12 /Doc/lib/libitertools.tex
parent291f14e3d386714ea937489e1863bed7f818a970 (diff)
downloadcpython-88821f7c2020eccd8c41cf1926be465abda7a1c4.zip
cpython-88821f7c2020eccd8c41cf1926be465abda7a1c4.tar.gz
cpython-88821f7c2020eccd8c41cf1926be465abda7a1c4.tar.bz2
Important usability fix in itertools documentation.
Diffstat (limited to 'Doc/lib/libitertools.tex')
-rw-r--r--Doc/lib/libitertools.tex6
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/lib/libitertools.tex b/Doc/lib/libitertools.tex
index 4f025e3..d17fc6f 100644
--- a/Doc/lib/libitertools.tex
+++ b/Doc/lib/libitertools.tex
@@ -348,15 +348,15 @@ from building blocks.
>>> def all(pred, seq):
... "Returns True if pred(x) is True for every element in the iterable"
-... return not nth(ifilterfalse(pred, seq), 0)
+... return False not in imap(pred, seq)
>>> def some(pred, seq):
... "Returns True if pred(x) is True at least one element in the iterable"
-... return bool(nth(ifilter(pred, seq), 0))
+... return True in imap(pred, seq)
>>> def no(pred, seq):
... "Returns True if pred(x) is False for every element in the iterable"
-... return not nth(ifilter(pred, seq), 0)
+... return True not in imap(pred, seq)
>>> def padnone(seq):
... "Returns the sequence elements and then returns None indefinitely"