@@ -71,16 +71,18 @@ Python 3.8, although type checker authors are encouraged to support it.
71
71
Stubs are treated as if ``from __future__ import annotations `` is enabled.
72
72
In particular, built-in generics and forward references can be used.
73
73
74
- Starting with Python 3.8, the ast _ module from the standard library supports
74
+ Starting with Python 3.8, the :py:mod: ` ast ` module from the standard library supports
75
75
all syntax features required by this PEP. Older Python versions can use the
76
- typed_ast _ package, which also supports Python 3.7 syntax and ``# type ``
76
+ `typed_ast <https://pypi.org/project/typed-ast/ >`_ package from the
77
+ Python Package Index, which also supports Python 3.7 syntax and ``# type ``
77
78
comments.
78
79
79
80
Distribution
80
81
============
81
82
82
83
Type stubs can be distributed with or separately from the implementation;
83
- see PEP 561 [#pep561 ]_ for more information. The typeshed _ project
84
+ see PEP 561 [#pep561 ]_ for more information. The
85
+ `typeshed <https://github.com/python/typeshed >`_ project
84
86
includes stubs for Python's standard library and several third-party
85
87
packages. These are usually distributed with type checkers and do not
86
88
require separate installation.
@@ -989,36 +991,6 @@ No::
989
991
Point = NamedTuple("Point", [('x', float), ('y', float)])
990
992
Thing = TypedDict("Thing", {'stuff': str, 'index': int})
991
993
992
- Existing Tools
993
- ==============
994
-
995
- Type Checkers
996
- -------------
997
-
998
- * mypy [#mypy ]_, the reference implementation for type checkers.
999
- Supports Python 2 and 3.
1000
- * pyre [#pyre ]_, written in OCaml and optimized for performance.
1001
- Supports Python 3 only.
1002
- * pyright [#pyright ]_, a type checker that emphasizes speed. Supports Python 3
1003
- only.
1004
- * pytype [#pytype ]_, checks and infers types for unannotated code.
1005
- Supports Python 2 and 3.
1006
-
1007
- Development Environments
1008
- ------------------------
1009
-
1010
- * PyCharm [#pycharm ]_, an IDE that supports type stubs both for type
1011
- checking and code completion.
1012
- * Visual Studio Code [#vscode ]_, a code editor that supports type
1013
- checking using mypy, pyright, or the Pylance [#pylance ]_ extension.
1014
-
1015
- Linters and Formatters
1016
- ----------------------
1017
-
1018
- * black [#black ]_, a code formatter with support for type stub files.
1019
- * flake8-pyi [#flake8-pyi ]_, a plugin for the flake8 linter [#flake8 ]_ that adds support for
1020
- type stubs.
1021
-
1022
994
References
1023
995
==========
1024
996
@@ -1038,31 +1010,6 @@ PEPs
1038
1010
.. [#pep613 ] PEP 613 -- Explicit Type Aliases, Zhu (https://www.python.org/dev/peps/pep-0613)
1039
1011
.. [#pep3107 ] PEP 3107 -- Function Annotations, Winter and Lownds (https://www.python.org/dev/peps/pep-3107)
1040
1012
1041
- Type Checkers
1042
- -------------
1043
-
1044
- .. [#mypy ] mypy -- Optional Static Typing for Python (http://www.mypy-lang.org/)
1045
- .. [#pyre ] Pyre -- A performant type-checker for Python 3 (https://pyre-check.org/)
1046
- .. [#pyright ] pyright -- Static type checker for Python (https://github.com/microsoft/pyright)
1047
- .. [#pytype ] pytype -- A static analyzer for Python code (https://github.com/google/pytype)
1048
-
1049
- IDEs with Typing Support
1050
- ------------------------
1051
-
1052
- .. [#pycharm ] PyCharm -- The Python IDE for Professional Developers (https://www.jetbrains.com/pycharm/)
1053
- .. [#pylance ] Pylance -- Fast, feature-rich language support for Python (https://github.com/microsoft/pylance-release)
1054
- .. [#vscode ] Visual Studio Code -- Code Editing. Redefined (https://code.visualstudio.com/)
1055
-
1056
- Other Resources
1057
- ---------------
1058
-
1059
- .. [#black ] black -- The uncompromising code formatter (https://black.readthedocs.io/)
1060
- .. [#flake8 ] Flake8 -- Your Tool For Style Guide Enforcement (http://flake8.pycqa.org/)
1061
- .. [#flake8-pyi ] flake8-pyi -- A plugin for Flake8 that provides specializations for type hinting stub files (https://github.com/ambv/flake8-pyi)
1062
- .. [#typeshed ] typeshed -- Collection of library stubs for Python, with static types (https://github.com/python/typeshed)
1063
- .. [#ast ] ast -- Abstract Syntax Trees, Python standard library module (https://docs.python.org/3/library/ast.html)
1064
- .. [#typed_ast ] typed_ast -- Fork of CPython's ast module (https://pypi.org/project/typed-ast/)
1065
-
1066
1013
Copyright
1067
1014
=========
1068
1015
0 commit comments