-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Widen type to Any when isinstance(..., Any) is True #3751
Conversation
test-data/unit/check-isinstance.test
Outdated
@@ -1770,3 +1770,13 @@ def narrow_any_to_str_then_reassign_to_int() -> None: | |||
reveal_type(v) # E: Revealed type is 'Any' | |||
|
|||
[builtins fixtures/isinstance.pyi] | |||
|
|||
[case testIsinstanceWidensWithAnyArg] |
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 think this is a good fix, but could you please add few more tests:
- With an error and
# type: ignore
- With an "un-imported"
Any
- With an initial type that is not a union
This appeared again, are you still working on this PR? |
@miedzinski Are you interested in finishing this PR? |
@JukkaL Yes, I am. I have merged master into my branch and will look into this weekend. |
@ilevkivskyi Do you have any ideas for more test cases? |
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.
LGTM, thanks!
Fixes #3474.