From 88757510c1cb42becfd7ad8682fe670f9d7a3b5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Vask=C3=B3?= <1771332+vlaci@users.noreply.github.com> Date: Tue, 21 Jan 2025 15:28:15 +0100 Subject: [PATCH] chore: help pyright 1.1.392 figure out the correct typing of pairwise This unblocks #1082 --- unblob/iter_utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/unblob/iter_utils.py b/unblob/iter_utils.py index 240c3415ff..fe92441c5b 100644 --- a/unblob/iter_utils.py +++ b/unblob/iter_utils.py @@ -1,7 +1,11 @@ import itertools +from collections.abc import Iterable, Iterator +from typing import TypeVar +T = TypeVar("T") -def pairwise(iterable): + +def pairwise(iterable: Iterable[T]) -> Iterator[tuple[T, T]]: # Copied from Python 3.10 # pairwise('ABCDEFG') --> AB BC CD DE EF FG a, b = itertools.tee(iterable)