New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
False positive unused-private-member
if class member is accessed via self
#4644
Comments
Thank you, I can reproduce this. |
This will be fixed in |
I get this error on classmethods no matter what, regardless of self-use and no mutation needed: Snippet:
|
Dear @Pierre-Sassoulas, this issue is still here in Versions: $ pylint --version
pylint 3.0.0-a4
astroid 2.6.6
Python 3.9.5 (default, May 19 2021, 11:32:47)
[GCC 9.3.0] MWE: class A():
__CLS_ATTR = 0 # pylint: unused-private-member
def __init__(self, t_int_int: tuple[int, int]):
self._object_attr: tuple[int, int] = t_int_int
def get_first_int(self) -> int:
return self._object_attr[self.__CLS_ATTR] Thank your for your help ! |
Hey, it's because 3.0 alpha is pylint 2.8 with some breaking change rebased on it. I might release a new 3.0 alpha rebased on 2.11 when we fix the problem with the current alpha version. |
Steps to reproduce
Given a file
p.py
:Current behavior
Result of
pylint p.py
:Expected behavior
No diagnostics.
pylint --version output
Result of
pylint --version
output:The text was updated successfully, but these errors were encountered: