Special typing form to define “literal types”.
typing.Literal
def validate_simple(data: Any) -> Literal[True]: always returns True
...
Mode: TypeAlias = Literal['r', 'rb', 'w', 'wb']
def open_helper(file: str, mode: Mode) -> str:
...
open_helper('/some/path', 'r') Passes type check
open_helper('/other/path', 'typo') Error in type checker