-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
I have the following code snippet:
class A:
def __enter__(self):
return self
def __exit__(self, err_type, err, traceback):
return
class B(A):
def foo(self):
pass
with B() as b:
b.foo()When running pylint on this, I get
no_member.py:10:4: E1101: Instance of '_Aa' has no 'b_method' member (no-member)
If I add a __enter__ and __exit__ to B, I get no error.
I only get this error depending on pylint version combined with astroid version
I have tried it with both Python 3.6 and 3.7
pylint 2.4.x - Always fails
pylint 2.3.x - Fails with newer astroid
pylint 2.3.x - Passes with astroid==2.2.5
I have seen some similar issues, but not found anyone really like this.
Steps to reproduce
- Use python 3.6 or 3.7
- Install latest pylint
- Run pylint on code above
Current behavior
no_member.py:10:4: E1101: Instance of '_Aa' has no 'b_method' member (no-member)
Expected behavior
Not that error
pylint --version output
pylint 2.4.2
astroid 2.3.1
Python 3.7.3 (default, Jun 19 2019, 21:29:22)
sam-s, eight04 and feluxe