-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
No error if derived type is different from annotated type #3945
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
Comments
Is this within an annotated function? This works correctly for me when I type check a file containing just
|
Ah yes, sorry. It is inside an annotated function! |
Can you give a more complete example and the mypy command line that you use that fails to generate the error? This should work. |
I get no error if I run
However, If I annotate it, I get the following error ->
|
Mypy doesn't type check functions that don't have a signature (in this case, |
IIUC this is tracked in #3948 so I am closing this now. |
Uh oh!
There was an error while loading. Please reload this page.
Take this incorrectly annotated example:
Gives no mypy error. Surely if mypy knows that
Type(int)
is different toType(bool)
, we could have a new mypy warning ofAnnotated type different to derived type
?The text was updated successfully, but these errors were encountered: