diff options
author | Georg Brandl <georg@python.org> | 2008-02-01 11:56:49 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-02-01 11:56:49 (GMT) |
commit | f69451833191454bfef75804c2654dc37e8f3e93 (patch) | |
tree | 7e81560f5276c35f68b7b02e75feb9221a82ae5d /Doc/library/itertools.rst | |
parent | f25ef50549d9f2bcb6294fe61a9902490728edcc (diff) | |
download | cpython-f69451833191454bfef75804c2654dc37e8f3e93.zip cpython-f69451833191454bfef75804c2654dc37e8f3e93.tar.gz cpython-f69451833191454bfef75804c2654dc37e8f3e93.tar.bz2 |
Update docs w.r.t. PEP 3100 changes -- patch for GHOP by Dan Finnie.
Diffstat (limited to 'Doc/library/itertools.rst')
-rw-r--r-- | Doc/library/itertools.rst | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst index 58ed4fa..013ed38 100644 --- a/Doc/library/itertools.rst +++ b/Doc/library/itertools.rst @@ -177,7 +177,8 @@ loops that truncate the stream. 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. Equivalent to:: + 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: @@ -204,7 +205,8 @@ loops that truncate the stream. .. function:: imap(function, *iterables) Make an iterator that computes the function using arguments from each of the - iterables. Equivalent to:: + iterables. This function is the same as the built-in :func:`map` function. + Equivalent to:: def imap(function, *iterables): iterables = [iter(it) for it in iterables) @@ -230,7 +232,7 @@ loops that truncate the stream. def islice(iterable, *args): s = slice(*args) - it = iter(range(s.start or 0, s.stop or sys.maxsize, s.step or 1)) + it = range(s.start or 0, s.stop or sys.maxsize, s.step or 1) nexti = next(it) for i, element in enumerate(iterable): if i == nexti: |