-
-
Notifications
You must be signed in to change notification settings - Fork 277
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inferring property fields in a class context when metaclass is present #941
Inferring property fields in a class context when metaclass is present #941
Conversation
643d548
to
89fac51
Compare
da5f55a
to
35d2941
Compare
35d2941
to
b389805
Compare
b389805
to
39d359d
Compare
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.
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.
Overall it looks good. Just some small comments and a merge conflict. After those are resolved, this one can be merged.
5dcd0ed
to
f6f43ab
Compare
Ref pylint-dev#940. If we are accessing an attribute and it is found on type(A).__dict__ *and* it is a data descriptor, then we resolve that descriptor. For the case of inferring a property which is accessed as a class attribute, this equates to the property being defined on the metaclass (which may be anywhere in the class hierarchy).
f6f43ab
to
8afdc7b
Compare
Ref pylint-dev/pylint#3535. Ref pylint-dev/pylint#4358. This updates the namedtuple/enum brain to add a dictionary for __members__
8afdc7b
to
103f440
Compare
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.
👍🏻 Thanks again
Steps
Description
If we are accessing an attribute and it is found on
type(A).__dict__
and it is a data descriptor, then we resolve thatdescriptor. For the case of inferring a property which is accessed as a
class attribute, this equates to the property being defined on the
metaclass (which may be anywhere in the class hierarchy).
Type of Changes
Related Issue
Closes #940