pylint #89786 E0202, False Positive with properties [open]
First of all, the 'discussion' can be found on stackoverflow.com The following code will reproduce the problem (on python 2.7) with pylint 0.25.1 """example module""" class Example(object): """example class""" @property def aProperty(self): """get""" print "using getter" return self._myPropertyValue @aProperty.setter def aProperty(self, value): """set""" print "using setter" self._myPropertyValue = value def secondPublicMethodToIgnorePylintWarning(self): """dummy""" return self.aProperty def __init__(self): """init""" self._myPropertyValue = None self.aProperty = "ThisStatementWillRaise E0202" anExample = Example() print anExample.aProperty anExample.aProperty = "Second binding" print anExample.aProperty Output: using setter using getter ThisStatementWillRaise E0202 using setter using getter Second binding Pylint says however: E0202: 7,4:Example.aProperty: An attribute affected in test1 line 26 hide this method E0202: 13,4:Example.aProperty: An attribute affected in test1 line 26 hide this method | |
priority | normal |
---|---|
type | bug |
done in | 0.25.2 |
load | 0.000 |
load left | 0.000 |
closed by | <not specified> |