Skip to content

Fix self-referential upper bound in new-style type variables#17407

Merged
JelleZijlstra merged 2 commits into
python:masterfrom
ilevkivskyi:fix-type-var-bound
Jun 20, 2024
Merged

Fix self-referential upper bound in new-style type variables#17407
JelleZijlstra merged 2 commits into
python:masterfrom
ilevkivskyi:fix-type-var-bound

Conversation

@ilevkivskyi

Copy link
Copy Markdown
Member

Fixes #17347

This copies old-style TypeVar logic 1:1 (I know it is ugly, but I don't think there is anything better now). Also while I am touching this code, I am removing third_pass argument (third pass is not a thing for ~5 years now).

@ilevkivskyi ilevkivskyi requested a review from JukkaL June 19, 2024 23:21
@github-actions

This comment has been minimized.

@JukkaL JukkaL left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for fixing this! I couldn't remember how this all worked and was pretty confused when I briefly looked into this myself.

@github-actions

Copy link
Copy Markdown
Contributor

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

@JelleZijlstra JelleZijlstra merged commit f9d8f3a into python:master Jun 20, 2024
@ilevkivskyi ilevkivskyi deleted the fix-type-var-bound branch June 20, 2024 19:02
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.

Failed to resolve the boundary type in a PEP 695 new style definition

3 participants