mirror of
https://github.com/python/cpython.git
synced 2025-07-29 06:05:00 +00:00
Alter recipe to show how to call izip_longest() with
both a keyword argument and star arguments.
This commit is contained in:
parent
246daedd11
commit
f080e6d7e0
2 changed files with 2 additions and 4 deletions
|
@ -1236,8 +1236,7 @@ Samuele
|
|||
>>> 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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue