Skip to content

Fix forward references in type parameters of overparameterized PEP 695 type aliases#19725

Merged
ilevkivskyi merged 1 commit into
python:masterfrom
brianschubert:dpo-103305-tvar-placeholder
Aug 29, 2025
Merged

Fix forward references in type parameters of overparameterized PEP 695 type aliases#19725
ilevkivskyi merged 1 commit into
python:masterfrom
brianschubert:dpo-103305-tvar-placeholder

Conversation

@brianschubert

@brianschubert brianschubert commented Aug 25, 2025

Copy link
Copy Markdown
Collaborator

Fixes #19734

Make semanal defer for placeholders in the upper bounds / constraints, even when the type variable doesn't appear in the target.

https://discuss.python.org/t/mypy-raises-exception-for-certain-type-alias-definitions-with-parameters-bounded-by-a-not-yet-defined-type/103305

@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. ✅

@ilevkivskyi ilevkivskyi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LG! This is one of the places where the new syntax needs extra care.

@ilevkivskyi
ilevkivskyi merged commit 4847ec8 into python:master Aug 29, 2025
20 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

Development

Successfully merging this pull request may close these issues.

Crash for certain type alias definitions with parameter with parameter bounded by a forward type

2 participants