mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2024-09-21 08:31:52 +03:00
58019afd5b
* chunk coin_store request into smaller sql queries, to not exceed the limit of 999 on old versions of sqlite * extend tests for chunks
10 lines
228 B
Python
10 lines
228 B
Python
from typing import Iterator, List, TypeVar
|
|
|
|
T = TypeVar("T")
|
|
|
|
|
|
def chunks(in_list: List[T], size: int) -> Iterator[List[T]]:
|
|
size = max(1, size)
|
|
for i in range(0, len(in_list), size):
|
|
yield in_list[i : i + size]
|