-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
bugmypy got something wrongmypy got something wrongtopic-reveal-typereveal_type() and reveal_locals()reveal_type() and reveal_locals()
Description
Bug Report
reveal_locals() doesn't show module globals that are annotated with type information.
To Reproduce
from typing import List
global_var = [1, 2, 3]
global_var_annotated: List[int] = [1, 2, 3]
reveal_locals()
def foo():
local_var = [1, 2, 3]
local_var_annotated: List[int] = [1, 2, 3]
reveal_locals()
Expected Behavior
A note on the global_var_annotated variable:
note: global_var_annotated: builtins.list[builtins.int]
Actual Behavior
global_var_annotated is missing from the revealed types:
note: Revealed local types are:
note: global_var: builtins.list[builtins.int*]
note: Revealed local types are:
note: local_var: Any
note: local_var_annotated: builtins.list[builtins.int]
Your Environment
- mypy 0.931
- Python 3.7.7
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongtopic-reveal-typereveal_type() and reveal_locals()reveal_type() and reveal_locals()