-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
mypy duplicates reveal_type
notes with partial types
#18511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This could also happen before #18180 (when loops were repeatedly checked for other reasons), but you are right that #18180 increases the number of cases where this can happen. I realised this when working on it but was unsure whether this behaviour was a feature or a bug. The current behaviour tells us that the type must be |
I think it's worth it to stop these weird results by preventing early outputs from showing. (I think it's surprising more than confusing but surprising isn't a fun place to be.) That is unless #18516 includes redoing partial types. |
… robustly and efficiently, and avoid multiple `revealed type` notes for the same line. This change is an improvement over 9685171. Besides fixing the regression reported in python#18606 and removing the duplicates reported in python#18511, it should significantly reduce the performance regression reported in python#18991. At least running `Measure-command {python runtests.py self}` on my computer (with removed cache) is 10 % faster.
Bug Report
There's two notes from a single
reveal_type
with a partial type in a loop.To Reproduce
(the outer function is only necessary to make sure a transition to
--local-partial-types
doesn't render this test case useless)Expected Behavior
Actual Behavior
Your Environment
I assume this was caused by #18180. Checked on mypy playground.
mypy.ini
(and other config files): noneThe text was updated successfully, but these errors were encountered: