summaryrefslogtreecommitdiffstats
path: root/Doc/library/itertools.rst
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2008-03-13 00:19:26 (GMT)
committerRaymond Hettinger <python@rcn.com>2008-03-13 00:19:26 (GMT)
commit17301e9fab311badbbe26a1efcb2decf637b324a (patch)
tree1326aa6f309cc11fa17b4aee81c26eea77d47e1e /Doc/library/itertools.rst
parent45832ea4082c6df50021dbeb9a157aad851fdeb8 (diff)
downloadcpython-17301e9fab311badbbe26a1efcb2decf637b324a.zip
cpython-17301e9fab311badbbe26a1efcb2decf637b324a.tar.gz
cpython-17301e9fab311badbbe26a1efcb2decf637b324a.tar.bz2
Issue 2186 and 2187. Move filter from itertools to builtins.
Diffstat (limited to 'Doc/library/itertools.rst')
-rw-r--r--Doc/library/itertools.rst19
1 files changed, 2 insertions, 17 deletions
diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst
index 0d74c59..368e40d 100644
--- a/Doc/library/itertools.rst
+++ b/Doc/library/itertools.rst
@@ -234,21 +234,6 @@ loops that truncate the stream.
self.currkey = self.keyfunc(self.currvalue)
-.. function:: ifilter(predicate, iterable)
-
- Make an iterator that filters elements from iterable returning only those for
- which the predicate is ``True``. If *predicate* is ``None``, return the items
- that are true. This function is the same as the built-in :func:`filter`
- function. Equivalent to::
-
- def ifilter(predicate, iterable):
- if predicate is None:
- predicate = bool
- for x in iterable:
- if predicate(x):
- yield x
-
-
.. function:: ifilterfalse(predicate, iterable)
Make an iterator that filters elements from iterable returning only those for
@@ -606,13 +591,13 @@ which incur interpreter overhead. ::
def any(seq, pred=None):
"Returns True if pred(x) is true for at least one element in the iterable"
- for elem in ifilter(pred, seq):
+ for elem in filter(pred, seq):
return True
return False
def no(seq, pred=None):
"Returns True if pred(x) is false for every element in the iterable"
- for elem in ifilter(pred, seq):
+ for elem in filter(pred, seq):
return False
return True