Skip to content

Un-support narrowing final globals in functions#21241

Merged
ilevkivskyi merged 1 commit intopython:masterfrom
ilevkivskyi:unsupport-global-final-narrow
Apr 16, 2026
Merged

Un-support narrowing final globals in functions#21241
ilevkivskyi merged 1 commit intopython:masterfrom
ilevkivskyi:unsupport-global-final-narrow

Conversation

@ilevkivskyi
Copy link
Copy Markdown
Member

As discussed in #21119 this niche use case is tricky to support in parallel mode.

cc @JukkaL

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

Copy link
Copy Markdown
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

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

For existing use cases, creating a final alias with the narrowed type is a fairly easy workaround.

@ilevkivskyi ilevkivskyi merged commit c65ed9a into python:master Apr 16, 2026
24 checks passed
@ilevkivskyi ilevkivskyi deleted the unsupport-global-final-narrow branch April 16, 2026 12:16
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