-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Failing Test cases For Type Narrowing #20603
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
base: master
Are you sure you want to change the base?
Conversation
743acf4 to
96fffd3
Compare
test-data/unit/check-isinstance.test
Outdated
| if type(y) is int: # E: Subclass of "str" and "int" cannot exist: would have incompatible method signatures | ||
| y # E: Statement is unreachable | ||
| if type(y) is int: | ||
| y |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't quite get the change here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing can be a subclass of an integer and a string at the same time. This error existed in previous versions of Mypy, so I think we should not change it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like you removed the error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes - I have fixed that now
ef5cab5 to
f9c63f6
Compare
f9c63f6 to
f76e174
Compare
hauntsaninja
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! This conflicts with some of the changes I have queued up (meta issue #20564 ) / those changes fix some of this, so I will wait for those to land and rebase on top
Test cases added from #20277 (initial PR) after issue #20600 (failing test cases), caused by #20492 (type narrowing PR).
Failing cases have been marked with
-xfail