Fix string formatting for string enums by roberfi · Pull Request #16555 · python/mypy
Fixes #7563
Inside check_str_format_call method, it checks if expression of format method call is an Enum member and it takes Literal value of that Enum member to check the format call arguments, if so.
Diff from mypy_primer, showing the effect of this PR on open source code:
discord.py (https://github.com/Rapptz/discord.py): typechecking got 1.09x faster (194.1s -> 178.0s) (Performance measurements are based on a single noisy sample)
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix!
roberfi
deleted the
fix-string-enums-formatting
branch
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