stolichki/crawler/utils/__init__.py

4 lines
145 B
Python
Raw Permalink Normal View History

2024-01-03 14:34:15 +10:00
def chunks(lst: list, n: int):
"""Yield successive n-sized chunks from lst."""
for i in range(0, len(lst), n):
yield lst[i:i + n]