Given a sample snippet like this:
class Bar:
@classmethod
def from_xyz(cls):
return cls()
class Foo(Bar):
@classmethod
def from_xyz(cls):
return super(Foo, cls).from_xyz()
def Baz(self):
print("Hello World!")
x = Foo.from_xyz()
x.Baz()
pylint will print the error:
lint.py:15:0: E1101: Instance of 'Bar' has no 'Baz' member (no-member)
pylint will either recognize that:
and as a result, will not print a false positive.
pylint 2.3.1
astroid 2.2.5
Python 3.7.4 (default, Jul 9 2019, 16:32:37)
[GCC 9.1.1 20190503 (Red Hat 9.1.1-1)]
Yeah, right now pylint emits the error as it cannot constrain the result of from_xyz to Foo. Definitely a bug that's worth fixing.
Most helpful comment
Yeah, right now
pylintemits the error as it cannot constrain the result offrom_xyztoFoo. Definitely a bug that's worth fixing.