summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2009-02-14 04:21:49 (GMT)
committerRaymond Hettinger <python@rcn.com>2009-02-14 04:21:49 (GMT)
commit9e8dbbcdcd462efc8f50008c7182dd399de89097 (patch)
tree205c44bc862e68369139148a4309c72d2598ca4b /Doc/library
parent8c20189ce4bb26b18306a7b5fc05db62cf6e9a11 (diff)
downloadcpython-9e8dbbcdcd462efc8f50008c7182dd399de89097.zip
cpython-9e8dbbcdcd462efc8f50008c7182dd399de89097.tar.gz
cpython-9e8dbbcdcd462efc8f50008c7182dd399de89097.tar.bz2
Add keyword argument support to itertools.count().
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/itertools.rst5
1 files changed, 3 insertions, 2 deletions
diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst
index fda3beb..ad5a23b 100644
--- a/Doc/library/itertools.rst
+++ b/Doc/library/itertools.rst
@@ -194,15 +194,16 @@ loops that truncate the stream.
.. versionadded:: 3.1
-.. 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:`map` to generate consecutive data points.
Also, used with :func:`zip` 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