Admit that Final variables are never redefined by sterliakov · Pull Request #19083 · python/mypy
Navigation Menu
{{ message }}
- Notifications You must be signed in to change notification settings
- Fork 3.2k
Merged
hauntsaninja merged 3 commits intopython:masterfrom
May 13, 2025Merged
Admit that Final variables are never redefined#19083
hauntsaninja merged 3 commits intopython:masterfrom
Admit that Final variables are never redefined#19083
hauntsaninja merged 3 commits intopython:masterfrom
Conversation
Copy link Copy Markdown
Collaborator
sterliakov
commented
May 12, 2025
sterliakov
commented
Fixes #19080. There is no point applying our heuristics if the variable is declared Final - it is not reassigned anywhere.
sterliakov added 2 commits
May 12, 2025 22:44
This comment has been minimized.
This comment has been minimized.
hauntsaninja approved these changes May 12, 2025
Copy link Copy Markdown
Collaborator
hauntsaninja
left a comment
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!
test-data/unit/check-final.test
Outdated
Show resolved
Hide resolved
test-data/unit/check-final.test Outdated Show resolved Hide resolved
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Copy link Copy Markdown
Contributor
github-actions
bot
commented
May 13, 2025
github-actions bot commented
May 13, 2025According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment