Python, examples of TypeVar using
Example 1: python function argument type
def pick(l: list, index: int) -> int:
return l[index]
Example 2: python typing list of strings
from typing import List
def my_func(l: List[int]):
pass
def pick(l: list, index: int) -> int:
return l[index]
from typing import List
def my_func(l: List[int]):
pass