-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
AstroidRelated to astroidRelated to astroidEnhancement ✨Improvement to a componentImprovement to a componentNeeds PRThis issue is accepted, sufficiently specified and now needs an implementationThis issue is accepted, sufficiently specified and now needs an implementation
Description
Bug description
Pylint produces an incorrect unsubscriptable-object warning.
"""A test case."""
import numpy as np
class Foo:
"""Class docstring."""
csvfilename = None
csvdata = None
def __init__(self, filename):
cls = self.__class__
assert filename is not None
if cls.csvfilename != filename:
cls.csvdata = np.zeros(10)
cls.csvfilenanme = filename
self.generation = cls.csvdata[0]
Command used
pylint testcase.py
Pylint output
************* Module testcase
testcase.py:16:26: E1136: Value 'cls.csvdata' is unsubscriptable (unsubscriptable-object)
Expected behavior
No warning should be emitted.
Pylint version
pylint 3.0.2
astroid 3.0.1
Python 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0]
OS / Environment
Ubuntu 22.04
Metadata
Metadata
Assignees
Labels
AstroidRelated to astroidRelated to astroidEnhancement ✨Improvement to a componentImprovement to a componentNeeds PRThis issue is accepted, sufficiently specified and now needs an implementationThis issue is accepted, sufficiently specified and now needs an implementation