Section: Typing and enums

Generic list alias

python
python
def first(items: list[str]) -> str:
    return items[0]

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
Optional type
Optional type
OpenIn sheetpythonsame section
Enum
Enum
OpenIn sheetpythonsame section
Chain iterables
Chain iterables
Parse JSON
Parse JSON