Skip to content

Commit b3ec171

Browse files
committed
chore: help pyright 1.1.392 figure out the correct typing of pairwise
This unblocks #1082
1 parent 1eb720f commit b3ec171

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

unblob/iter_utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import itertools
2+
from collections.abc import Iterable, Iterator
3+
from typing import TypeVar
24

5+
T = TypeVar("T")
36

4-
def pairwise(iterable):
7+
8+
def pairwise(iterable: Iterable[T]) -> Iterator[tuple[T, T]]:
59
# Copied from Python 3.10
610
# pairwise('ABCDEFG') --> AB BC CD DE EF FG
711
a, b = itertools.tee(iterable)

0 commit comments

Comments
 (0)