mirror of
https://github.com/pretix/pretix.git
synced 2026-05-06 15:24:02 +00:00
11 lines
207 B
Python
11 lines
207 B
Python
import itertools
|
|
|
|
|
|
def chunked_iterable(iterable, size):
|
|
it = iter(iterable)
|
|
while True:
|
|
chunk = tuple(itertools.islice(it, size))
|
|
if not chunk:
|
|
break
|
|
yield chunk
|