Skip to content
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

Reject promotions when checking against protocols. #18360

Conversation

tyralla
Copy link
Collaborator

@tyralla tyralla commented Dec 29, 2024

Fixes #18359
Fixes #18257
Linking #18343

The change is simple but may be way too general. Making it more precise should be straightforward, but I want to see the Mypy Primer results and hear other opinions first.

Copy link
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

Copy link
Collaborator

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, promotions should be entirely about nominal typing

(Generally speaking, I think float.hex is a small wart that we should not contort too hard to get type safety for. See also python/cpython#100268 (comment))

@hauntsaninja hauntsaninja merged commit ac6151a into python:master Dec 29, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants