Consider the following function
import typing def make_list(el : typing.Any): return [el, el]
That's what TypeVar is for:
from typing import TypeVar, List T = TypeVar('T') def make_list(el: T) -> List[T]: return [el, el]