Why
PEP 585 enabled collections in the Python standard library (like list) to be used as generics directly, instead of importing analogous members from the typing module (like typing.List).
When available, the PEP 585 syntax should be used instead of importing members from the typing module, as it's more concise and readable.
What to do
- adopt these type hints in the Haystack Experimental codebase
- add the corresponding ruff rule to pyproject.toml to enforce this requirement