We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
file.py
import numpy as np var = -np.diff(np.array([1, 2.5, 5])) print(type(var))
pylint file.py
Pylint output contains file.py:3:6: E1130: bad operand type for unary -: generator (invalid-unary-operand-type).
file.py:3:6: E1130: bad operand type for unary -: generator (invalid-unary-operand-type)
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 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)]
The text was updated successfully, but these errors were encountered:
@eniemela3 thank you for the report. It should have been corrected through pylint-dev/astroid#664. Can you confirm please? Thanks again.
Sorry, something went wrong.
No branches or pull requests
Steps to reproduce
file.py
with the following contents: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
The text was updated successfully, but these errors were encountered: