Skip to content

Latest commit

 

History

History
100 lines (73 loc) · 2.66 KB

index.rst

File metadata and controls

100 lines (73 loc) · 2.66 KB

Static Typing with Python

Guides

.. toctree::
   :maxdepth: 2

   guides/index

Reference

.. toctree::
   :maxdepth: 2

   reference/index

.. seealso::

   The documentation at https://mypy.readthedocs.io/ is relatively accessible
   and complete.

Specification

.. toctree::
   :maxdepth: 2

   spec/index

Indices and tables

Discussions and Support

Typing-related Tools

Type Checkers

  • mypy, the reference implementation for type checkers.
  • pyre, a type checker written in OCaml and optimized for performance.
  • pyright, a type checker that emphasizes speed.
  • pytype, a type checker that checks and infers types for unannotated code.

Development Environments

  • PyCharm, an IDE that supports type stubs both for type checking and code completion.
  • Visual Studio Code, a code editor that supports type checking using mypy, pyright, or the Pylance extension.

Linters and Formatters

  • black, a code formatter with support for type stub files.
  • flake8-pyi, a plugin for the flake8 linter that adds support for type stubs.
  • ruff, a linter built for speed, with support for most of the flake8-pyi rules.

Type-Hint and Stub Integration

  • autotyping, a tool which infers simple types from their context and inserts them as inline type-hints.
  • merge-pyi, a thin wrapper around ApplyTypeAnnotationsVisitor from libCST that integrates .pyi signatures as inline type-hints in Python source code.

Typing PEPs

See https://peps.python.org/topic/typing for a list of all typing-related PEPs.