mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
Branch merge
This commit is contained in:
commit
9e06e37be0
1 changed files with 2 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue