KEMBAR78
Admit that Final variables are never redefined by sterliakov · Pull Request #19083 · python/mypy · GitHub
Skip to content

Conversation

sterliakov
Copy link
Collaborator

Fixes #19080. There is no point applying our heuristics if the variable is declared Final - it is not reassigned anywhere.

@github-actions

This comment has been minimized.

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.

Nice, thank you!

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
@github-actions
Copy link
Contributor

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

@hauntsaninja hauntsaninja merged commit 0b65f21 into python:master May 13, 2025
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

Development

Successfully merging this pull request may close these issues.

mypy doesn't narrow Final objects in nested contexts

2 participants