diff options
author | Raymond Hettinger <python@rcn.com> | 2009-02-14 00:25:51 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2009-02-14 00:25:51 (GMT) |
commit | a4038038c69c72f96f1c7d435d50818c46892591 (patch) | |
tree | d766cc7067bdf647a2ee974bc4e20d77bd245ddc /Doc/library/itertools.rst | |
parent | 544c3e19e6b6c8162c45a22594c6b929fd14f427 (diff) | |
download | cpython-a4038038c69c72f96f1c7d435d50818c46892591.zip cpython-a4038038c69c72f96f1c7d435d50818c46892591.tar.gz cpython-a4038038c69c72f96f1c7d435d50818c46892591.tar.bz2 |
Add keyword argument support to itertools.count().
Diffstat (limited to 'Doc/library/itertools.rst')
-rw-r--r-- | Doc/library/itertools.rst | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst index 4dfc083..89d5056 100644 --- a/Doc/library/itertools.rst +++ b/Doc/library/itertools.rst @@ -200,20 +200,20 @@ loops that truncate the stream. .. versionadded:: 2.7 -.. function:: count(n=0, step=1) +.. function:: count(start=0, step=1) Make an iterator that returns evenly spaced values starting with *n*. Often used as an argument to :func:`imap` to generate consecutive data points. Also, used with :func:`izip` to add sequence numbers. Equivalent to:: - def count(n=0, step=1): + def count(start=0, step=1): # count(10) --> 10 11 12 13 14 ... # count(2.5, 0.5) -> 3.5 3.0 4.5 ... + n = start while True: yield n n += step - .. versionchanged:: 2.7 added *step* argument and allowed non-integer arguments. |