From fa86a3cd2376a2549cf8f5ccf93a7163023f2e7b Mon Sep 17 00:00:00 2001 From: Ethan Smith Date: Tue, 19 Jun 2018 14:24:19 -0700 Subject: [PATCH] PEP 561: add typeshed if a package is partial (#676) --- pep-0561.rst | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/pep-0561.rst b/pep-0561.rst index ddfd83c42..c1c2018c9 100644 --- a/pep-0561.rst +++ b/pep-0561.rst @@ -188,13 +188,15 @@ Partial Stub Packages Many stub packages will only have part of the type interface for libraries completed, especially initially. For the benefit of type checking and code editors, packages can be "partial". This means modules not found in the stub -package SHOULD be searched for in the corresponding runtime package. +package SHOULD be searched for in parts four and five of the module resolution +order above, namely inline packages and typeshed. -Type checkers should merge the stub package and runtime package directories. -This can be thought of as the functional equivalent of copying the stub package -into the same directory as the corresponding runtime package and type checking -the combined directory structure. Thus type checkers MUST maintain the normal -resolution order of checking ``*.pyi`` before ``*.py`` files. +Type checkers should merge the stub package and runtime package or typeshed +directories. This can be thought of as the functional equivalent of copying the +stub package into the same directory as the corresponding runtime package or +typeshed folder and type checking the combined directory structure. Thus type +checkers MUST maintain the normal resolution order of checking ``*.pyi`` before +``*.py`` files. Stub packages can opt into declaring themselves as partial by including ``partial\n`` in the package's ``py.typed`` file. @@ -224,7 +226,12 @@ Vlasovskikh, Nathaniel Smith, and Guido van Rossum. Version History =============== +* 2018-06-19 + + * Partial stub packages can look at typeshed as well as runtime packages + * 2018-05-15 + * Add partial stub package spec. * 2018-04-09