Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork3.1k
Refactor/unify access to static attributes#19254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This comment has been minimized.
This comment has been minimized.
According tomypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
JukkaL left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Nice to see more duplicate code paths getting merged!
929377a intopython:masterUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Fixes#3832
Fixes#5723
Fixes#17174
Improves#7217
This is a sixth "major" PR toward#7724. Previously access to "static" attributes (like type aliases, class objects) was duplicated in four places:
analyze_ref_expr()determine_type_of_member()(for modules as subtypes of protocols)Most of these were somewhat incomplete and/or inconsistent, this PR unifies all four (there is still tiny duplication because I decided to limit the number of deferrals, i.e. preserve the existing logic in this respect). Some notable things that are not pure refactoring:
Instance("typing.TypeVar").TypeInfos andTypeAliases, now they are applied always.TypeOfAnyin couple places to be more logical.