Repository navigation
Support or in isinstance checks - #1712
Merged
Merged
Conversation
| [builtins fixtures/isinstance.py] | ||
| [out] | ||
| main: note: In function "h": | ||
| main:13: error: Incompatible return value type (got "object", expected "int") |
Collaborator
There was a problem hiding this comment.
Can you use a # E: comment here to make the test case easier to read?
rwbarton
force-pushed
the
rwbarton-isinstance
branch
from
June 16, 2016 02:59
172ac66 to
d025588
Compare
Contributor
Author
|
Done (and rebased). |
| flag = 2 | ||
| def f(x: A) -> int: | ||
| if isinstance(x, B) or isinstance(x, C): | ||
| return x.flag |
Collaborator
There was a problem hiding this comment.
I suggest revealing the type of x here.
Collaborator
|
LGTM! Some minor nits about test cases and comments above. |
There was also a slight logic error in the old version (when left_if_vars was None but right_if_vars was not, the branch was treated as reachable). Fix it and add a test for that case.
rwbarton
force-pushed
the
rwbarton-isinstance
branch
from
June 22, 2016 20:47
d025588 to
56ce18d
Compare
Contributor
Author
|
Thanks for the thorough review. I had meant to add more documentation about |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #942.