What is the correct type annotation for a function that returns a Sequence of the same type as one of its inputs?
What is the correct type annotation for a function that returns a Sequence of the same type as one of its inputs? Question: For the Python code from typing import TypeVar, Sequence, Iterator S = TypeVar("S", bound=Sequence) def chunk(data: S) -> S: return data[:] mypy 0.971 reports the error simple_8.py:6:12: error: Incompatible return value type …