Run pylint vs the following example
from __future__ import annotations
from dataclasses import dataclass
@dataclass
class Point:
x: int
y: int
dx: int
dy: int
def move(self):
self.x += self.dx
self.y += self.dy
sample.py:13:8: E1101: Instance of 'Point' has no 'x' member; maybe 'y'? (no-member)
sample.py:14:8: E1101: Instance of 'Point' has no 'y' member; maybe 'x'? (no-member)
No warnings are expected I guess. Before updating to 2.4.0 there were no reports.
pylint 2.4.1
astroid 2.3.0
Python 3.7.4 (v3.7.4:e09359112e, Jul 8 2019, 14:54:52)
[Clang 6.0 (clang-600.0.57)]
Another example that had no errors in 2.3.1 but fails with no-member in 2.4.1:
from dataclasses import dataclass
@dataclass
class MyClass:
attribute: str
@dataclass
class MyChildClass(MyClass):
def method(self):
print(self.attribute) # no-member
Failing versions
astroid==2.3.0
pylint==2.4.1
Passing versions:
astroid==2.2.4
pylint==2.3.1
This should be fixed with https://github.com/PyCQA/astroid/commit/3e4eac76e9abfa0400fa07b58c61973ac5495bd2 which will be part of astroid 2.3.1 shortly.
Fedora 31: bug triggered.
Fedora 31 + updates: bug fixed.
Most helpful comment
This should be fixed with https://github.com/PyCQA/astroid/commit/3e4eac76e9abfa0400fa07b58c61973ac5495bd2 which will be part of astroid 2.3.1 shortly.