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
I hope I haven't made a mistake by asking here instead of in the mypy repository.
Is there a rationale for the discrepancy in the types in this two cases? In the first case (if_stmt), reveal_type correctly identifies the types, while in the second case (match_stmt), None seemingly appears out of nowhere. As I understand, is the issue related to type narrowing?
...
main.py:35: note: Revealed type is "TypedDict('__main__.IntArrayElements', {'elements': builtins.list[builtins.int]})"
main.py:38: note: Revealed type is "builtins.list[builtins.int]"
...
Actual Behavior
...
main.py:35: note: Revealed type is "Union[TypedDict('__main__.IntArrayElements', {'elements': builtins.list[builtins.int]}), None]"
...
main.py:38: note: Revealed type is "Union[builtins.list[builtins.int], Any]"
...
The text was updated successfully, but these errors were encountered:
I hope I haven't made a mistake by asking here instead of in the mypy repository.
Is there a rationale for the discrepancy in the types in this two cases? In the first case (
if_stmt
),reveal_type
correctly identifies the types, while in the second case (match_stmt
),None
seemingly appears out of nowhere. As I understand, is the issue related to type narrowing?Code
gist, mypy-playground
Expected Behavior
Actual Behavior
The text was updated successfully, but these errors were encountered: