Closed mwchase closed 4 years ago
Something as in the following example?
class A:
def test(self):
"a"
print(A().test.__doc__)
print(A.test.__doc__)
If so, can you try with pylint@master and astroid@master and let me know if you can reproduce it or not, please?
I had to modify the code slightly:
class A:
def test(self):
"a"
test.__doc__ += 'b'
print(A().test.__doc__)
print(A.test.__doc__)
No config file found, using default configuration pylint 2.0.0, astroid 1.5.0 Python 3.5.1 (v3.5.1:37a07cee5969, Dec 5 2015, 21:12:44) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]
The precise output differs slightly between the two versions. Both versions ding the assignment and the second print statement, but 1.6.4 also dings the first print statement.
Steps to reproduce
Current behavior
Code executes fine, pylint generates an Error message: "Method '[...]' has no 'doc' member (no-member)"
Expected behavior
Pylint should not generate an error message for the doc member, because it is in fact defined. (Even if there's no docstring, it's still None.)
pylint --version output
No config file found, using default configuration pylint 1.6.4, astroid 1.4.8 Python 3.5.1 (v3.5.1:37a07cee5969, Dec 5 2015, 21:12:44) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]
(Edited the title to reflect the reproduction below.)