************************* Static Typing with Python ************************* .. Introduction .. ============ .. .. .. toctree:: .. :maxdepth: 2 .. .. source/introduction Guides ====== .. toctree:: :maxdepth: 2 source/guides Reference ========= .. toctree:: :maxdepth: 2 source/reference Indices and tables ================== * :ref:`genindex` * :ref:`search` Discussions and Support ======================= * `User help forum `_ * `User chat on Gitter `_ * `Developer mailing list `_ Typing-related Tools ==================== Type Checkers ------------- * `mypy `_, the reference implementation for type checkers. Supports Python 2 and 3. * `pyre `_, written in OCaml and optimized for performance. Supports Python 3 only. * `pyright `_, a type checker that emphasizes speed. Supports Python 3 only. * `pytype `_, checks and infers types for unannotated code. Supports Python 2 and 3. 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. Typing PEPs =========== * `PEP 483 `_, background on type hints * `PEP 484 `_, type hints * `PEP 526 `_, variable annotations and ``ClassVar`` * `PEP 544 `_, ``Protocol`` * `PEP 561 `_, distributing typed packages * `PEP 563 `_, ``from __future__ import annotations`` * `PEP 585 `_, subscriptable generics in the standard library * `PEP 586 `_, ``Literal`` * `PEP 589 `_, ``TypedDict`` * `PEP 591 `_, ``Final`` * `PEP 593 `_, ``Annotated`` * `PEP 604 `_, union syntax with ``|`` * `PEP 612 `_, ``ParamSpec`` * `PEP 613 `_, ``TypeAlias`` * `PEP 646 `_, variadic generics and ``TypeVarTuple`` * `PEP 647 `_, ``TypeGuard`` * `PEP 655 `_, ``Required`` and ``NotRequired`` * `PEP 673 `_, ``Self`` * `PEP 675 `_, ``LiteralString`` * `PEP 677 `_ (rejected), callable type syntax * `PEP 681 `_ (draft), ``@dataclass_transform()``