Skip to content

Commit

Permalink
chore: help pyright 1.1.392 figure out the correct typing of pairwise
Browse files Browse the repository at this point in the history
This unblocks #1082
  • Loading branch information
vlaci committed Jan 21, 2025
1 parent 1eb720f commit 8875751
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion unblob/iter_utils.py
Original file line number Diff line number Diff line change
@@ -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)
Expand Down

0 comments on commit 8875751

Please sign in to comment.