Skip to content

Conversation

@George-Ogden
Copy link
Contributor

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

@George-Ogden George-Ogden force-pushed the xfail-narrowing branch 2 times, most recently from 6d4f19a to 64f9b22 Compare January 16, 2026 22:02
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
Copy link
Collaborator

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?

Copy link
Contributor Author

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.

Co-authored-by: A5rocks <git@helvetica.moe>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants