Tweak the typing spec's module resolution to more closely emulate Python's runtime semantics #1772
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements the changes to the typing spec's module resolution order that have been proposed on Discourse. Three changes have been made:
--custom-typeshed-dir
option; pyright provides thetypeshedPath
configuration-file option; pyre provides the--typeshed
option). This update to the spec formally specifies that doing so is highly encouraged.Please see the Discourse topic for a detailed rationale for these changes, and please post any substantive feedback on the proposed changes there rather than on this PR. (Suggestions for minor wording improvements are welcome here.)
As discussed on Discourse, the proposed new specification appears to already be implemented by mypy, but pyright's behaviour would have to change to become conformant with the new spec. (I have not surveyed pyre's and pytype's module resolution behaviour.)