Clarify ordering of PEP 561 module resolution (#807)
As brought up in python/mypy#5520.
This commit is contained in:
parent
97cb9542da
commit
c509ce282e
|
@ -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``.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue