papermario/tools/n64splat/util/iter.py
Ethan Roseman 5e12a46dd4 git subrepo clone (merge) https://github.com/ethteck/n64splat.git tools/n64splat
subrepo:
  subdir:   "tools/n64splat"
  merged:   "7574db712"
upstream:
  origin:   "https://github.com/ethteck/n64splat.git"
  branch:   "master"
  commit:   "7574db712"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo.git"
  commit:   "2f68596"
2021-01-15 10:26:06 +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)