typy

beta

FAQ

What are type hints?

Type hints were introduced in Python 3.5. 1 They provide a way to add static type information to our code. Type hints are optional. Like comments, they don't have any effect at runtime, but they can provide information to external tools like a type checker.

What is a type checker?

A type checker is a tool which analyzes our code without running it (i.e. statically). It can warn us about things which might cause errors at runtime. Types can also provide more information to your editor for better autocomplete, refactoring tools, etc.

What type checker does typy use?

There is no official Python type checker. Instead, the rules of the static type system are specified in PEPs.2 These specifications are implemented by various third party tools, like mypy or Pyright.

typy is built on Pyright.

Footnotes

  1. Type hints were originally specifed in PEP 483 and PEP 484.

  2. Python typing module docs provide a list of relevant PEPs.