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

Cannot determine type of a function with a no_type_check decorator #663

Closed
JukkaL opened this issue May 12, 2015 · 0 comments · Fixed by #666
Closed

Cannot determine type of a function with a no_type_check decorator #663

JukkaL opened this issue May 12, 2015 · 0 comments · Fixed by #666
Labels
bug mypy got something wrong

Comments

@JukkaL
Copy link
Collaborator

JukkaL commented May 12, 2015

Mypy complains if I call a no_type_check function above the definition:

import typing

def f() -> None:
    foo()  # Error: Cannot determine type of 'foo'

@typing.no_type_check
def foo(x: {1:2}) -> [1]:
    1 + 'x'

We should detect no_type_check during semantic analysis and set the type of the Decorator object to Any there, before type checking.

@JukkaL JukkaL added bug mypy got something wrong priority labels May 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant