diff options
author | Georg Brandl <georg@python.org> | 2009-06-01 17:35:27 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2009-06-01 17:35:27 (GMT) |
commit | 3dd3388229995e00cf0ba858700576a79de0d6ec (patch) | |
tree | 7592304f798f920d045323b9cea5808c28096410 /Doc/library/itertools.rst | |
parent | 5ce83a004fc0904a43c901c4144c041e2a4155d7 (diff) | |
download | cpython-3dd3388229995e00cf0ba858700576a79de0d6ec.zip cpython-3dd3388229995e00cf0ba858700576a79de0d6ec.tar.gz cpython-3dd3388229995e00cf0ba858700576a79de0d6ec.tar.bz2 |
Convert all "i" docs to new style optional args.
Diffstat (limited to 'Doc/library/itertools.rst')
-rw-r--r-- | Doc/library/itertools.rst | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst index fa4484d..e6a9fe2 100644 --- a/Doc/library/itertools.rst +++ b/Doc/library/itertools.rst @@ -1,4 +1,3 @@ - :mod:`itertools` --- Functions creating iterators for efficient looping ======================================================================= @@ -291,7 +290,7 @@ loops that truncate the stream. yield x -.. function:: groupby(iterable[, key]) +.. function:: groupby(iterable, key=None) Make an iterator that returns consecutive keys and groups from the *iterable*. The *key* is a function computing a key value for each element. If not @@ -372,7 +371,7 @@ loops that truncate the stream. then the step defaults to one. -.. function:: permutations(iterable[, r]) +.. function:: permutations(iterable, r=None) Return successive *r* length permutations of elements in the *iterable*. @@ -430,7 +429,7 @@ loops that truncate the stream. The number of items returned is ``n! / (n-r)!`` when ``0 <= r <= n`` or zero when ``r > n``. -.. function:: product(*iterables[, repeat]) +.. function:: product(*iterables, repeat=1) Cartesian product of input iterables. @@ -460,7 +459,7 @@ loops that truncate the stream. yield tuple(prod) -.. function:: repeat(object[, times]) +.. function:: repeat(object, times=-1) Make an iterator that returns *object* over and over again. Runs indefinitely unless the *times* argument is specified. Used as argument to :func:`map` for @@ -505,7 +504,7 @@ loops that truncate the stream. break -.. function:: tee(iterable[, n=2]) +.. function:: tee(iterable, n=2) Return *n* independent iterators from a single iterable. Equivalent to:: @@ -531,7 +530,7 @@ loops that truncate the stream. :func:`list` instead of :func:`tee`. -.. function:: zip_longest(*iterables[, fillvalue]) +.. function:: zip_longest(*iterables, fillvalue=None) Make an iterator that aggregates elements from each of the iterables. If the iterables are of uneven length, missing values are filled-in with *fillvalue*. |