Closed
Description
https://mypy.readthedocs.io/en/latest/type_narrowing.html
Example:
from typing import Callable, Union
x: Union[int, Callable[[], int]]
if callable(x):
reveal_type(x) # N: Revealed type is "def () -> builtins.int"
else:
reveal_type(x) # N: Revealed type is "builtins.int"