Skip to content

incorrect error reported for numpy #3640

@lhfriedman

Description

@lhfriedman

Steps to reproduce

  1. Use this test code in file flat_iter.py
    import numpy as np
    a_0 = np.array([[1, 2, 3]])
    print(a_0)
    a_0.flat[1] = 2**14
    print(a_0)

[[1 2 3]]
[[ 1 16384 3]]

pylint flat_iter.py
************* Module flat_iter
flat_iter.py:14:0: E1137: 'a_0.flat' does not support item assignment (unsupported-assignment-operation)


Your code has been rated at 0.00/10

Current behavior

reports E1137

Expected behavior

ignores correct python code

pylint --version output

pylint 2.5.0
astroid 2.4.0
Python 3.7.7 (default, May 6 2020, 11:45:54) [MSC v.1916 64 bit (AMD64)]

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions