summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2008-07-31 01:19:50 (GMT)
committerRaymond Hettinger <python@rcn.com>2008-07-31 01:19:50 (GMT)
commitf080e6d7e027c9576814dd57af3122ab2aff7aa9 (patch)
treec3a9b7ebef7a4dfce9f371d85a21af15986933db /Doc
parent246daedd11b7b2155963ffc1bf2b77518fd9b2e0 (diff)
downloadcpython-f080e6d7e027c9576814dd57af3122ab2aff7aa9.zip
cpython-f080e6d7e027c9576814dd57af3122ab2aff7aa9.tar.gz
cpython-f080e6d7e027c9576814dd57af3122ab2aff7aa9.tar.bz2
Alter recipe to show how to call izip_longest() with
both a keyword argument and star arguments.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/itertools.rst3
1 files changed, 1 insertions, 2 deletions
diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst
index 6bda2cf..db38e69 100644
--- a/Doc/library/itertools.rst
+++ b/Doc/library/itertools.rst
@@ -647,8 +647,7 @@ which incur interpreter overhead.
def grouper(n, iterable, fillvalue=None):
"grouper(3, 'ABCDEFG', 'x') --> ABC DEF Gxx"
args = [iter(iterable)] * n
- kwds = dict(fillvalue=fillvalue)
- return izip_longest(*args, **kwds)
+ return izip_longest(fillvalue=fillvalue, *args)
def roundrobin(*iterables):
"roundrobin('ABC', 'D', 'EF') --> A D E B F C"