You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 None in the first and can be either None or str in subsequent iterations. If there is consent that this is more confusing than helpful, we could likely extend the logic of #18433 to remove "early" results.
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.
I guess #18516 would not remove the need to check some loops repeatedly and, hence, would not fix this issue automatically. Additionally, I suppose, with --allow-redefinition disabled, things could generally stay as they are. But @JukkaL should know this more certainly.
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: