We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When parsing the following a.py:
a.py
class Test: __slots__ = ["a", "b", "c"] class TestChild(Test): __slots__ += ["d", "e", "f"] t = TestChild() print(t.__slots__)
pylint a.py
Traceback (most recent call last): File "c:\Users\Matth\.vscode\extensions\ms-python.pylint-2023.10.1\bundled\libs\pylint\lint\pylinter.py", line 788, in _lint_file check_astroid_module(module) File "c:\Users\Matth\.vscode\extensions\ms-python.pylint-2023.10.1\bundled\libs\pylint\lint\pylinter.py", line 1017, in check_astroid_module retval = self._check_astroid_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "c:\Users\Matth\.vscode\extensions\ms-python.pylint-2023.10.1\bundled\libs\pylint\lint\pylinter.py", line 1069, in _check_astroid_module walker.walk(node) File "c:\Users\Matth\.vscode\extensions\ms-python.pylint-2023.10.1\bundled\libs\pylint\utils\ast_walker.py", line 94, in walk self.walk(child) File "c:\Users\Matth\.vscode\extensions\ms-python.pylint-2023.10.1\bundled\libs\pylint\utils\ast_walker.py", line 91, in walk callback(astroid) File "c:\Users\Matth\.vscode\extensions\ms-python.pylint-2023.10.1\bundled\libs\pylint\checkers\classes\class_checker.py", line 879, in visit_classdef self._check_slots(node) File "c:\Users\Matth\.vscode\extensions\ms-python.pylint-2023.10.1\bundled\libs\pylint\checkers\classes\class_checker.py", line 1492, in _check_slots for slots in node.ilookup("__slots__"): File "c:\Users\Matth\.vscode\extensions\ms-python.pylint-2023.10.1\bundled\libs\astroid\bases.py", line 194, in _infer_stmts raise InferenceError( astroid.exceptions.InferenceError: Inference failed for all members of [<AssignName.__slots__ l.5 at 0x14ef5196a20>]. The above exception was the direct cause of the following exception: Traceback (most recent call last): File "c:\Users\Matth\.vscode\extensions\ms-python.pylint-2023.10.1\bundled\libs\pylint\lint\pylinter.py", line 752, in _lint_files self._lint_file(fileitem, module, check_astroid_module) File "c:\Users\Matth\.vscode\extensions\ms-python.pylint-2023.10.1\bundled\libs\pylint\lint\pylinter.py", line 790, in _lint_file raise astroid.AstroidError from e astroid.exceptions.AstroidError
No crash.
pylint 3.0.2 astroid 3.0.1 Python 3.12.1 (tags/v3.12.1:2305ca5, Dec 7 2023, 22:03:25) [MSC v.1937 64 bit (AMD64)]
win32 (Windows)
The text was updated successfully, but these errors were encountered:
__slots__
jacobtylerwalls
Successfully merging a pull request may close this issue.
Bug description
When parsing the following
a.py
:Command used
Pylint output
pylint crashed with a ``AstroidError`` and with the following stacktrace:
Expected behavior
No crash.
Pylint version
OS / Environment
win32 (Windows)
The text was updated successfully, but these errors were encountered: