Closed
Description
from typing import Dict
xs = {} # type: Dict[str, str]
reveal_type(xs)
def foo():
xs = {} # type: Dict[str, str]
reveal_type(xs)
$ mypy mypytest.py
mypytest.py:4: error: Revealed type is 'builtins.dict[builtins.str, builtins.str]'
mypytest.py: note: In function "foo":
mypytest.py:8: error: Revealed type is 'Any'
Expected result
MyPy should reveal builtins.dict[builtins.str, builtins.str]
in both cases
Actual result
MyPy correctly reveals type on module-level, but reveals Any
inside the function
Metadata
Metadata
Assignees
Labels
No labels