Make it easier to search for the grouper() recipe.
This commit is contained in:
parent
86a20f834a
commit
9ae9473389
|
@ -705,7 +705,8 @@ which incur interpreter overhead.
|
|||
return zip(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 zip_longest(*args, fillvalue=fillvalue)
|
||||
|
||||
|
|
Loading…
Reference in New Issue