Closed
Description
I have a class looking like this:
from collection import Iterable, Iterator
class IterableWrapper(Iterator, Iterable, BaseWrapper):
...
And a function type definition later going:
# type: (...) -> IterableWrapper[tuple[T, T2]]
Mypy complains:
src/ww/wrappers/iterables.py:600: error: "IterableWrapper" expects no type arguments, but 1 given
While:
# type: (...) -> IterableWrapper
and # type: (...) -> Iterable[tuple[T, T2]]
don't get any warning.
I was expecting that, inheriting from Iterable,
I could do IterableWrapper[tuple[T, T2]]
like I would do Iterable[tuple[T, T2]]
and benefit from code checking on yielded elements.