Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Partially add type hints to synapse.util #9982

Merged
merged 11 commits into from
May 24, 2021
Prev Previous commit
Next Next commit
Switch to Tuple.
  • Loading branch information
clokep committed May 24, 2021
commit 0b93de5ab9ff2a23dcb332057803d8abf15fb607
3 changes: 2 additions & 1 deletion synapse/util/iterutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@
Mapping,
Sequence,
Set,
Tuple,
TypeVar,
)

T = TypeVar("T")


def batch_iter(iterable: Iterable[T], size: int) -> Iterator[Collection[T]]:
def batch_iter(iterable: Iterable[T], size: int) -> Iterator[Tuple[T, ...]]:
"""batch an iterable up into tuples with a maximum size

Args:
Expand Down