Execute pylint on the following code:
"""Demo of the assignment-from-no-return pylint false positive"""
import numpy as np
def demo():
"""Demo of the false positive, at line z = ..."""
x = np.array([0, 1, 0, 1], dtype=np.bool)
y = np.array([0, 0, 1, 1], dtype=np.bool)
z = np.logical_or(x, y)
print(np.array([x, y, z]))
if __name__ == "__main__":
demo()
assignment-from-no-return(E1111): test.py:10:4: demo: Assigning result of a function call, where the function has no return
No issue
pylint 2.2.2
astroid 2.1.0
Python 3.6.8 |Anaconda, Inc.| (default, Dec 30 2018, 01:22:34)
[GCC 7.3.0]
Thanks for the report!
For the record, this affects other functions too, such as numpy.equal.
and numpy.divide
numpy.log as well
Any update as to the cause of this? or what versions this didn't occur on? could be a numpy issue?
@jordyjwilliams It has to do with the release of numpy==1.16 pinning numpy<1.16 has fixed CI linting for me for now, but I like this to be fixed for the newer numpy
Does anyone know if this needs fixing on pylint's or numpy's part?
This is on pylint's side.
@PCManticore any idea on when this will be fixed?
Can confirm same problem for a lot more Numpy functions, for example deg2rad(), arctan(), and more presumably. Moreover, array item assignment (such as arr[i] = x) suffers from unsupported-assignment-operation.
+1 to all these issues
Should be fixed with the latest master of astroid.
@PCManticore That was quick! The commit says release date tba. Are we talking days or weeks?
Weeks most likely, I'll do a dev release in a bit, but the final one might be somewhere in February.
Most helpful comment
Should be fixed with the latest
masterof astroid.