Skip to content

Incorrect 'unsubscriptable-object' reported #9590

Open
@ei14

Description

@ei14

Steps to reproduce

Running pylint 3.1.0 to this code will warn about incorrect 'unsubscriptable-object':

import numpy as np

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

Current behavior

Running pylint warns:

************* Module test
example.py:5:6: E1136: Value 'converted' is unsubscriptable (unsubscriptable-object)

------------------------------------------------------------------
Your code has been rated at 0.00/10 (previous run: 0.00/10, +0.00)

Expected behavior

No warn

pylint --version output

pylint 3.1.0
astroid 3.1.0
Python 3.12.3 (main, Apr 23 2024, 09:16:07) [GCC 13.2.1 20240417]

Maybe related to: #3139 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    False Positive 🦟A message is emitted but nothing is wrong with the codeLib specific 💅This affect the code from a particular libraryNeeds PRThis issue is accepted, sufficiently specified and now needs an implementation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions