pylint
pylint copied to clipboard
Attributes set in metaclass reported `no-member`
Question
This was the simplest snippet I could create to reproduce my issue. The aloha attribute is reported as no-member.
class ParentMetaclass(type):
def __init__(cls, what, bases=None, attrs=None):
super().__init__(what, bases, attrs)
cls.aloha = 'test'
class Parent(metaclass=ParentMetaclass):
def handle(self):
raise NotImplementedError
class Test(Parent):
def handle(self) -> None:
return self.aloha # false positive [no-member]
I noticed there are some other issues related, but they either don't address the question or they are a slightly different issue.
Any news about this?
There's a branch with a regression tests; https://github.com/pylint-dev/pylint/compare/issue-3339. The whole activity is always going to be in the issue (unless we fixed it in a duplicate without realizing).