summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2003-10-20 17:01:07 (GMT)
committerGuido van Rossum <guido@python.org>2003-10-20 17:01:07 (GMT)
commit0c9a318d644c3a5ef0d611cc5a35a5cbd7e7b929 (patch)
tree857f20aa0760f83ab2d600c36aad34667ea4560b
parentf0dfc7ac5c2f76baaae0c3b45bc339281cfa2adc (diff)
downloadcpython-0c9a318d644c3a5ef0d611cc5a35a5cbd7e7b929.zip
cpython-0c9a318d644c3a5ef0d611cc5a35a5cbd7e7b929.tar.gz
cpython-0c9a318d644c3a5ef0d611cc5a35a5cbd7e7b929.tar.bz2
Use 'predicate = bool' as the default predicate for ifilter[false].
-rw-r--r--Doc/lib/libitertools.tex6
1 files changed, 2 insertions, 4 deletions
diff --git a/Doc/lib/libitertools.tex b/Doc/lib/libitertools.tex
index 30d80c1..aec55cb 100644
--- a/Doc/lib/libitertools.tex
+++ b/Doc/lib/libitertools.tex
@@ -140,8 +140,7 @@ by functions or loops that truncate the stream.
\begin{verbatim}
def ifilter(predicate, iterable):
if predicate is None:
- def predicate(x):
- return x
+ predicate = bool
for x in iterable:
if predicate(x):
yield x
@@ -157,8 +156,7 @@ by functions or loops that truncate the stream.
\begin{verbatim}
def ifilterfalse(predicate, iterable):
if predicate is None:
- def predicate(x):
- return x
+ predicate = bool
for x in iterable:
if not predicate(x):
yield x