Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

please improve error messages when functions decorated with @typechecked are called with incorrect types #112

Open
sg-s opened this issue Dec 22, 2021 · 0 comments

Comments

@sg-s
Copy link

sg-s commented Dec 22, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant