Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions pep-0561.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down