From 88821f7c2020eccd8c41cf1926be465abda7a1c4 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Tue, 22 Jul 2003 06:33:13 +0000 Subject: Important usability fix in itertools documentation. --- Doc/lib/libitertools.tex | 6 +++--- 1 file 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" -- cgit v0.12