Clarify ordering of PEP 561 module resolution (#807)

As brought up in python/mypy#5520.
This commit is contained in:
Ethan Smith 2018-10-11 20:36:04 -07:00 committed by Guido van Rossum
parent 97cb9542da
commit c509ce282e
1 changed files with 3 additions and 2 deletions

View File

@ -163,13 +163,14 @@ Type Checker Module Resolution Order
The following is the order in which type checkers supporting this PEP SHOULD The following is the order in which type checkers supporting this PEP SHOULD
resolve modules containing type information: resolve modules containing type information:
1. User code - the files the type checker is running on.
2. Stubs or Python source manually put in the beginning of the path. Type 1. Stubs or Python source manually put in the beginning of the path. Type
checkers SHOULD provide this to allow the user complete control of which checkers SHOULD provide this to allow the user complete control of which
stubs to use, and to patch broken stubs/inline types from packages. stubs to use, and to patch broken stubs/inline types from packages.
In mypy the ``$MYPYPATH`` environment variable can be used for this. In mypy the ``$MYPYPATH`` environment variable can be used for this.
2. User code - the files the type checker is running on.
3. Stub packages - these packages SHOULD supersede any installed inline 3. Stub packages - these packages SHOULD supersede any installed inline
package. They can be found at ``foopkg-stubs`` for package ``foopkg``. package. They can be found at ``foopkg-stubs`` for package ``foopkg``.