New semantic analyzer: Support builtin typing aliases#6358
Merged
ilevkivskyi merged 23 commits intopython:masterfrom Feb 12, 2019
Merged
New semantic analyzer: Support builtin typing aliases#6358ilevkivskyi merged 23 commits intopython:masterfrom
ilevkivskyi merged 23 commits intopython:masterfrom
Conversation
added 3 commits
February 7, 2019 17:52
Member
Author
|
Supporting |
JukkaL
reviewed
Feb 12, 2019
Collaborator
JukkaL
left a comment
There was a problem hiding this comment.
This moves us very close to being able to support full builtins stubs! Looks good, just left a few minor comments. Feel free to merge after you've addressed them.
| # Tuple is special because it is involved in builtin import cycle | ||
| # and may be not ready when used. | ||
| sym = self.api.lookup_fully_qualified_or_none('builtins.tuple') | ||
| if not sym or isinstance(sym.node, PlaceholderNode): |
Collaborator
There was a problem hiding this comment.
What happens if we don't use the correct fixture that defined tuple? Will this still generate a reasonable error message?
Member
Author
There was a problem hiding this comment.
I fixed this to report a reasonable error, and added a test.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #6297
This adds support for real typeshed stubs that define dummy aliases like
typing.List,typing.Dict, etc. This also fixes couple related issues, so that builtin SCC is almost clean (the two remaining errors are #6295 and #6357).Most notably, this PR introduces some re-ordering of targets in builtin SCC, removing this reordering requires some non-trivial work (namely #6356, #6355, and deferring targets from
named_type()).