Make it easier to search for the grouper() recipe.

This commit is contained in:
Raymond Hettinger 2012-07-08 16:04:03 -07:00
parent 86a20f834a
commit 9ae9473389
1 changed files with 2 additions and 1 deletions

View File

@ -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)