papermario/tools/splat/util/iter.py
Ethan Roseman dc72859546 rename
2021-01-25 00:19:48 +09:00

6 lines
167 B
Python

from itertools import zip_longest
def iter_in_groups(iterable, n, fillvalue=None):
args = [iter(iterable)] * n
return zip_longest(*args, fillvalue=fillvalue)