mirror of https://github.com/python/cpython
Make it easier to search for the grouper() recipe.
This commit is contained in:
parent
2aa8519f07
commit
e16c882584
|
@ -733,7 +733,8 @@ which incur interpreter overhead.
|
|||
return izip(a, b)
|
||||
|
||||
def grouper(n, iterable, fillvalue=None):
|
||||
"grouper(3, 'ABCDEFG', 'x') --> ABC DEF Gxx"
|
||||
"Collect data into fixed-length chunks or blocks"
|
||||
# grouper(3, 'ABCDEFG', 'x') --> ABC DEF Gxx"
|
||||
args = [iter(iterable)] * n
|
||||
return izip_longest(fillvalue=fillvalue, *args)
|
||||
|
||||
|
|
Loading…
Reference in New Issue