1************************* 2Static Typing with Python 3************************* 4 5.. Introduction 6.. ============ 7.. 8.. .. toctree:: 9.. :maxdepth: 2 10.. 11.. source/introduction 12 13Guides 14====== 15 16.. toctree:: 17 :maxdepth: 2 18 19 source/guides 20 21Reference 22========= 23 24.. toctree:: 25 :maxdepth: 2 26 27 source/reference 28 29Indices and tables 30================== 31 32* :ref:`genindex` 33* :ref:`search` 34 35Discussions and Support 36======================= 37 38* `User help forum <https://github.com/python/typing/discussions>`_ 39* `User chat on Gitter <http://gitter.im/python/typing>`_ 40* `Developer mailing list <https://mail.python.org/archives/list/[email protected]/>`_ 41 42Typing-related Tools 43==================== 44 45Type Checkers 46------------- 47 48* `mypy <http://mypy-lang.org/>`_, the reference implementation for type 49 checkers. Supports Python 2 and 3. 50* `pyre <https://pyre-check.org/>`_, written in OCaml and optimized for 51 performance. Supports Python 3 only. 52* `pyright <https://github.com/microsoft/pyright>`_, a type checker that 53 emphasizes speed. Supports Python 3 only. 54* `pytype <https://google.github.io/pytype/>`_, checks and infers types for 55 unannotated code. Supports Python 2 and 3. 56 57Development Environments 58------------------------ 59 60* `PyCharm <https://www.jetbrains.com/pycharm/>`_, an IDE that supports 61 type stubs both for type checking and code completion. 62* `Visual Studio Code <https://code.visualstudio.com/>`_, a code editor that 63 supports type checking using mypy, pyright, or the 64 `Pylance <https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance>`_ 65 extension. 66 67Linters and Formatters 68---------------------- 69 70* `black <https://black.readthedocs.io/>`_, a code formatter with support for 71 type stub files. 72* `flake8-pyi <https://github.com/ambv/flake8-pyi>`_, a plugin for the 73 `flake8 <https://flake8.pycqa.org/>`_ linter that adds support for type 74 stubs. 75 76Typing PEPs 77=========== 78 79* `PEP 483 <https://www.python.org/dev/peps/pep-0483/>`_, background on type hints 80* `PEP 484 <https://www.python.org/dev/peps/pep-0484/>`_, type hints 81* `PEP 526 <https://www.python.org/dev/peps/pep-0526/>`_, variable annotations and ``ClassVar`` 82* `PEP 544 <https://www.python.org/dev/peps/pep-0544/>`_, ``Protocol`` 83* `PEP 561 <https://www.python.org/dev/peps/pep-0561/>`_, distributing typed packages 84* `PEP 563 <https://www.python.org/dev/peps/pep-0563/>`_, ``from __future__ import annotations`` 85* `PEP 585 <https://www.python.org/dev/peps/pep-0585/>`_, subscriptable generics in the standard library 86* `PEP 586 <https://www.python.org/dev/peps/pep-0586/>`_, ``Literal`` 87* `PEP 589 <https://www.python.org/dev/peps/pep-0589/>`_, ``TypedDict`` 88* `PEP 591 <https://www.python.org/dev/peps/pep-0591/>`_, ``Final`` 89* `PEP 593 <https://www.python.org/dev/peps/pep-0593/>`_, ``Annotated`` 90* `PEP 604 <https://www.python.org/dev/peps/pep-0604/>`_, union syntax with ``|`` 91* `PEP 612 <https://www.python.org/dev/peps/pep-0612/>`_, ``ParamSpec`` 92* `PEP 613 <https://www.python.org/dev/peps/pep-0613/>`_, ``TypeAlias`` 93* `PEP 646 <https://www.python.org/dev/peps/pep-0646/>`_, variadic generics and ``TypeVarTuple`` 94* `PEP 647 <https://www.python.org/dev/peps/pep-0647/>`_, ``TypeGuard`` 95* `PEP 655 <https://www.python.org/dev/peps/pep-0655/>`_, ``Required`` and ``NotRequired`` 96* `PEP 673 <https://www.python.org/dev/peps/pep-0673/>`_, ``Self`` 97* `PEP 675 <https://www.python.org/dev/peps/pep-0675/>`_, ``LiteralString`` 98* `PEP 677 <https://www.python.org/dev/peps/pep-0677/>`_ (rejected), callable type syntax 99* `PEP 681 <https://www.python.org/dev/peps/pep-0681/>`_ (draft), ``@dataclass_transform()`` 100