https://mypy.readthedocs.io/en/latest/type_narrowing.html Example: ```python 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" ``` Related #11088 Related https://github.com/python/mypy/pull/11150