Hi, hope this snippet helps, runs fine, but ty complains
Expected Iterator[str] | Iterator[int], found Iterator[str | int]
from itertools import groupby
from typing import Sequence, Iterator
def group(items: Sequence[str] | Sequence[int]):
for key, group in groupby(items):
f(group)
def f(items: Iterator[str] | Iterator[int]):
print(list(items))
group(["a", "b", "c"])
group([1, 2, 3])
Hi, hope this snippet helps, runs fine, but ty complains
Expected
Iterator[str] | Iterator[int], foundIterator[str | int]