You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Build a venv with pylint 2.7.4 and astroid 2.5.3, e.g. via pipenv install pylint==2.7.4 astroid==2.5.3.
Run pylint on the following file via e.g. pipenv run pylint --disable=all --enable=assigning-non-slot broken.py:
fromtypingimportGeneric, TypeVarT=TypeVar("T")
classBase(Generic[T]):
__slots__= ()
classFoo(Base[T]):
__slots__= ['_value']
def__init__(self, value: T):
# Triggers assigning-non-slot (Assigning to attribute '_value' not defined# in class slots), works when using Generic[T] directly as a base class.self._value=value
Current behavior
The steps above incorrectly trigger the assigning-non-slot check.
Expected behavior
No complaints from pylint. If you go back to astroid 2.5.2, the above works. If Foo directly inherits from Generic[T], the above works, too.
Bisecting shows that the commit cd0f896 introduced the regression. Therefore, every astroid >= 2.5.3 is buggy, as is every pylint >= 2.8.0.
The upstream issue was fixed:
pylint-dev/astroid#999
our pylint will be pinned to version 2.9.6 for some time
Change-Id: Ie70ff7b13ceef6ba8990e6b7a29cbdb2568f5d06
Steps to reproduce
pipenv install pylint==2.7.4 astroid==2.5.3
.pipenv run pylint --disable=all --enable=assigning-non-slot broken.py
:Current behavior
The steps above incorrectly trigger the
assigning-non-slot
check.Expected behavior
No complaints from pylint. If you go back to astroid 2.5.2, the above works. If
Foo
directly inherits fromGeneric[T]
, the above works, too.Bisecting shows that the commit cd0f896 introduced the regression. Therefore, every astroid >= 2.5.3 is buggy, as is every pylint >= 2.8.0.
python -c "from astroid import __pkginfo__; print(__pkginfo__.version)"
outputAs already mentioned above, the bug is present in every release containing the above commit, i.e. from 2.5.3 onwards.
The text was updated successfully, but these errors were encountered: