馃悰 fix(annotations): defer alias expansion - #766
Merged
Conversation
flying-sheep
marked this pull request as ready for review
September 4, 2026 10:10
flying-sheep
commented
Sep 4, 2026
Comment on lines
+42
to
+44
| def unescape(escaped: str) -> str: | ||
| escaped = escaped.replace("\x00", "") | ||
| return _UNESCAPE_RE.sub(r"\1", escaped) |
Contributor
Author
There was a problem hiding this comment.
moved this over here to prevent circular imports, and I think it fits here pretty well anyway.
flying-sheep
commented
Sep 4, 2026
Comment on lines
-574
to
+575
| assert '"int" | "list"["RecType"]' in result | ||
| # documented further down the same document, which only the resolve phase can know | ||
| assert '**some_param** ("RecType")' in result |
Contributor
Author
There was a problem hiding this comment.
this test changed because we鈥檙e now better at not expanding things that are documented.
gaborbernat
approved these changes
Sep 8, 2026
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.
Get rid of the order dependency of the alias expansion.
Now a type alias gets expanded when it鈥檚 not documented and not expanded when it鈥檚 documented.
After this PR (or as part of this PR), the code base could be simplified a bit by always deferring and resolving everything in the end, instead of opportunistically resolving things that can be resolved and deferring the rest.