Type hinting

Goals

Using type hints brings clarity, safety, and better tooling to your code — without changing how it runs. Type hints

  • make code self-documenting. You do not have to guess what types are expected or returned.

  • also enable code analysis tools to find type errors before runtime and helps coding assistance like auto-completion.

  • several libraries relies on type annotations especially for input validation.

This section covers: