The [typing.TypeVar](<https://docs.python.org/3/library/typing.html#typing.TypeVar>)
is a generic type factory. It’s primary goal is to serve as a parameter/placeholder for generic function/class/method annotations:
import typing
T = typing.TypeVar("T")
def get_first_element(l: typing.Sequence[T]) -> T:
return l[0]