Skip to content

Incorrect 'unsubscriptable-object' reported #3139

@atilag

Description

@atilag

Steps to reproduce

Running pylint 2.4.1 to this code will want about incorrect 'unsubscriptable-object':

import numpy as np

arr = np.array([1, 2, 3])
shape = arr.shape
print(shape[0])

Current behavior

Running pylint warns:

...
example.py:5:6: E1136: Value 'shape' is unsubscriptable (unsubscriptable-object)

Expected behavior

No warn

pylint --version output

pylint 2.4.1
astroid 2.3.0
Python 3.7.2 (default, Dec 29 2018, 00:00:04)
[Clang 4.0.1 (tags/RELEASE_401/final)]

Maybe related to: #3129 ?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions