pytypes
pytypes copied to clipboard
please improve error messages when functions decorated with @typechecked are called with incorrect types
this is what my function looks like:
@typechecked
def my_func(
a: int,
b: str,
):
I (deliberately) call the function with an incorrect type using:
my_func(1,1)
and I get this cryptic error message:
called with incompatible types:
Expected: Tuple[int, str]
Received: Tuple[int, int]
this is not very helpful because it doesn't flag the variable that is causing the problem, that is failing the type check.