Closed
Description
Steps to reproduce
- Create a file, say
file.py
with the following contents:
import numpy as np
var = -np.diff(np.array([1, 2.5, 5]))
print(type(var))
- Run
pylint file.py
Current behavior
Pylint output contains file.py:3:6: E1130: bad operand type for unary -: generator (invalid-unary-operand-type)
.
Expected behavior
The type of the return value from np.diff should be recognized correctly as a ndarray, not a generator, and the error should not be reported.
pylint --version output
pylint 2.3.1
astroid 2.2.5
Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:05:16) [MSC v.1915 32 bit (Intel)]
Metadata
Metadata
Assignees
Labels
No labels