Running Pylint on the following code will produce the error on the last line.
import statsmodels.api as sm
data = sm.datasets.longley.load_pandas().data
properties = ['GNP', 'POP']
specificData = data[properties]
Running Pylint gives
example.py|6 col 16 error| E1136: Value 'data' is unsubscriptable (unsubscriptable-object)
example.py|6 col 16 error| unsubscriptable-object: Value 'data' is unsubscriptable
No errors/warnings should be produced.
pylint 2.5.2
astroid 2.4.1
Python 3.7.7 (default, Apr 14 2020, 11:51:19)
[Clang 11.0.0 (clang-1100.0.33.12)]
Same problem with this:
import numpy as np
ARRAY = np.array([[1, 2, 3]]).T
print(ARRAY[0])
Value 'ARRAY' is unsubscriptable (unsubscriptable-object)
There should be no error.
Have a similar problem with type hints.
This LoC
EnvVarTypes = Union[str, int, float, bool, None]
gives E1136: Value 'Union' is unsubscriptable (unsubscriptable-object).
This LoC
def validate(self, line: str, _: GitCommit) -> List[Optional[RuleViolation]]:
gives E1136: Value 'Optional' is unsubscriptable (unsubscriptable-object).
BUT those errors only occur in with
$ pylint --version
pylint 2.6.0
astroid 2.4.2
Python 3.9.0 (default, Oct 6 2020, 02:47:17)
[GCC 7.5.0]
and not with
$ pylint --version
pylint 2.6.0
astroid 2.4.2
Python 3.8.6 (default, Oct 6 2020, 03:22:36)
[GCC 7.5.0]
This also breaks PEP 560 and PEP 585. See this comment at the related issue #3882.
@beauxq thanks for your comment. It seems your issue is not linked to the original one. Morevoer it should have been fixed through PyCQA/astroid#831.
@Cielquan thanks for your report. However your issue is not linked to the original one but it is due to the fact pylint is not yet supporting python3.9. We are working on it.
To any people thinking adding a comment here, please do only if your problem seems to be linked to panda's support in pylint. Otherwise please open another issue. Thanks.
Most helpful comment
@Cielquan thanks for your report. However your issue is not linked to the original one but it is due to the fact
pylintis not yet supportingpython3.9. We are working on it.