Section: Typing and enums

Optional type

python
python
def find_user(user_id: int) -> str | None:
    ...

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Typing and enums
Type alias
Type alias
OpenIn sheetpythonsame section
Typed dict
Typed dict
OpenIn sheetpythonsame section
Generic list alias
Generic list alias
OpenIn sheetpythonsame section
Enum
Enum
OpenIn sheetpythonsame section
Chain iterables
Chain iterables
Parse JSON
Parse JSON