-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
E1101 false positive with overridden properties #2221
Comments
This is an incredible unimportant edge case. I don't even understand what this code is supposed to be doing. |
The property in the subclass overrides the behaviour of the property in the parent class. I'm not sure why you think this is unimportant - isn't this a standard technique in object oriented Python? |
Why don't you just redefine the property in the child class, what does the "overriding" brings in this case different than doing:
Even if this pattern is useful with regards with setters, it still feels to be an antipattern and might even trip anyone reading this code without context. |
Hmm, I wasn't aware you could just redefine the property. Since that's the case, I think I agree with you. Thanks :-) |
Steps to reproduce
The following example of property overriding results in the pylint warning
E1101:Method 'some_property' has no 'getter' member
. The problem seems to be that pylint doesn't realise that@property
in the parent class is implicitly the getter referenced in the child class.Current behavior
Pylint warns
E1101:Method 'some_property' has no 'getter' member
.Expected behavior
Pylint should realise that
@Parent.some_property.getter
is equivalent to the parent'ssome_property
property.pylint --version output
The text was updated successfully, but these errors were encountered: