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

This commit is contained in:
Raymond Hettinger 2012-07-02 21:08:45 -07:00
parent 2aa8519f07
commit e16c882584
1 changed files with 2 additions and 1 deletions

View File

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