PEP 561: Point to mypy implementation and clarify stub package priority. (#613)
This commit is contained in:
parent
27becbf714
commit
18b869d1ce
23
pep-0561.rst
23
pep-0561.rst
|
@ -165,8 +165,8 @@ resolve modules containing type information:
|
|||
checkers SHOULD provide this to allow the user complete control of which
|
||||
stubs to use, and patch broken stubs/inline types from packages.
|
||||
|
||||
3. Stub packages - these packages can supersede the installed packages.
|
||||
They can be found at ``foopkg-stubs`` for package ``foopkg``.
|
||||
3. Stub packages - these packages SHOULD supersede any installed inline
|
||||
package. They can be found at ``foopkg-stubs`` for package ``foopkg``.
|
||||
|
||||
4. Inline packages - if there is nothing overriding the installed
|
||||
package, and it opts into type checking, inline types SHOULD be used.
|
||||
|
@ -189,10 +189,13 @@ Implementation
|
|||
==============
|
||||
|
||||
The proposed scheme of indicating support for typing is completely backwards
|
||||
compatible, and requires no modification to tooling. A sample package with
|
||||
inline types is available [typed_pkg]_, as well as a sample package checker
|
||||
[pkg_checker]_ which reads the metadata of installed packages and reports on
|
||||
their status as either not typed, inline typed, or a stub package.
|
||||
compatible, and requires no modification to package tooling. A sample package
|
||||
with inline types is available [typed_pkg]_, as well as a sample package
|
||||
checker [pkg_checker]_ which reads the metadata of installed packages and
|
||||
reports on their status as either not typed, inline typed, or a stub package.
|
||||
|
||||
The mypy type checker has an implementation of PEP 561 searching which can be
|
||||
read about in the mypy docs [4]_.
|
||||
|
||||
|
||||
Acknowledgements
|
||||
|
@ -206,6 +209,11 @@ Smith, and Guido van Rossum.
|
|||
Version History
|
||||
===============
|
||||
|
||||
* 2018-04-09
|
||||
|
||||
* Add reference to mypy implementation
|
||||
* Clarify stub package priority.
|
||||
|
||||
* 2018-02-02
|
||||
|
||||
* Change stub only package suffix to be -stubs not _stubs.
|
||||
|
@ -252,6 +260,9 @@ References
|
|||
.. [3] PEP 426 definitions
|
||||
(https://www.python.org/dev/peps/pep-0426/)
|
||||
|
||||
.. [4] Example implementation in a type checker
|
||||
(https://mypy.readthedocs.io/en/latest/installed_packages.html)
|
||||
|
||||
.. [typed_pkg] Sample typed package
|
||||
(https://github.com/ethanhs/sample-typed-package)
|
||||
|
||||
|
|
Loading…
Reference in New Issue