Type hints#

Python has support for type hints (or type annotations) that allow users to provide information on the type of variables.

Type hints can be used

  • by editors to provide better introspection into objects.

  • by tools like mypy that check your code given the variable types.

  • as additional documentation.

pytask uses type hints as part of its interface.

If you want to refresh your knowledge about type hints, follow this guide from FastAPI’s documentation that teaches you everything you need to know. (You can ignore the section about pydantic.)