Closed
Description
Bug Report
There's two notes from a single reveal_type
with a partial type in a loop.
To Reproduce
def main() -> None:
x = None
while True:
reveal_type(x)
x = ""
(the outer function is only necessary to make sure a transition to --local-partial-types
doesn't render this test case useless)
Expected Behavior
main.py:4: note: Revealed type is "Union[builtins.str, None]"
Success: no issues found in 1 source file
Actual Behavior
main.py:4: note: Revealed type is "None"
main.py:4: note: Revealed type is "Union[builtins.str, None]"
Success: no issues found in 1 source file
Your Environment
I assume this was caused by #18180. Checked on mypy playground.
- Mypy version used: master
- Mypy command-line flags: none
- Mypy configuration options from
mypy.ini
(and other config files): none - Python version used: 3.12