from typing import Union def foo() -> Union[int, str, None]: return 42