| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| [builtins fixtures/isinstance.py] | ||
| [out] | ||
| main: note: In function "h": | ||
| main:13: error: Incompatible return value type (got "object", expected "int") |
There was a problem hiding this comment.
Can you use a # E: comment here to make the test case easier to read?
Sorry, something went wrong.
|
Done (and rebased). |
Sorry, something went wrong.
| flag = 2 | ||
| def f(x: A) -> int: | ||
| if isinstance(x, B) or isinstance(x, C): | ||
| return x.flag |
There was a problem hiding this comment.
I suggest revealing the type of x here.
Sorry, something went wrong.
|
LGTM! Some minor nits about test cases and comments above. |
Sorry, something went wrong.
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.
|
Thanks for the thorough review. I had meant to add more documentation about TypeMap actually, and writing these made me notice that the behavior of isinstance(x, T) and isinstance(x, U) was actually nondeterministic. Pushed a new version addressing this and your other comments. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Fixes #942.