From: Raymond Hettinger Date: Mon, 20 Oct 2003 20:45:33 +0000 (+0000) Subject: Backport 1.19: X-Git-Tag: v2.3.3c1~125 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f5ab339a559a3771bb9293b0bdd0c8d987091888;p=thirdparty%2FPython%2Fcpython.git Backport 1.19: Use 'predicate = bool' as the default predicate for ifilter[false]. --- diff --git a/Doc/lib/libitertools.tex b/Doc/lib/libitertools.tex index dc1a77c39c8c..596406f176de 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