Is there a way to check if a variable is a given typing type?
I mean something like this:
def check_type(variable: Any, typing: Any) -> bool:
return variable is typing
check_type([1, 2, 3], List[int]) # True
check_type([1, 2, 3.4], List[int]) # False
check_type([1, 2, 3.4], List[Union[int, float]]) # True