From 18b869d1ce6eaf2e1c2b4b6a34aa25d20f30bcbc Mon Sep 17 00:00:00 2001 From: Ethan Smith Date: Tue, 10 Apr 2018 09:18:42 -0700 Subject: [PATCH] PEP 561: Point to mypy implementation and clarify stub package priority. (#613) --- pep-0561.rst | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/pep-0561.rst b/pep-0561.rst index 53d05ef26..6d89136b9 100644 --- a/pep-0561.rst +++ b/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)