-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
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
False positive: too-many-function-args for numpy #2326
Comments
Hi @jwkvam What version of
|
After some further debugging it seems this is only triggered with:
in my |
Thanks, now I can also reproduce it with |
Hi, Same kind of behaviour with : import numpy as np
np.timedelta64(10, 'ms') I also have Thanks ! |
For me I get
and numpy |
I can confirm that using: one_day = np.timedelta64(1, 'D') results in I have no
|
Same here: np.timedelta64(1, 'D) It might be something similar to what causes PyCharm to misinterpret skeletons for numpy. |
I'm also seeing this issue with
|
Same problem for me with np.timedelta64(1,'D'): "too many positional arguments" astroid 2.2.5 |
I still see this in
|
This is a helpful tool. Thank you. FYI - I'm getting this error with the following versions:
- E |
@EdmundsEcho @waiyip-aquabyte i'm unable to reproduce the bug with an astroid version >= 2.3.3. |
I'm also having this issue with numpy reshape (I think its because I am reshaping to add dimension so I'll use np.newaxis for now but it looks messier for this particular line of code. Using : and getting: E1121: Too many positional arguments for method call (too-many-function-args) as a response. |
We can get the error with:
It is because pylint doesn't understand that we can pass each element of the shape parameter as a separated argument, as stated in the documentation. |
@ntraut could you open a new bug issue please ? This one is unlikely to get any attention because it's closed. |
Steps to reproduce
test.py
https://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.reshape.html#numpy.ndarray.reshape
Current behavior
too-many-function-args
Expected behavior
No error
pylint --version output
pylint 2.0.0
astroid 2.0.1
Python 3.6.5 | packaged by conda-forge | (default, Apr 6 2018, 13:44:09)
[GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)]
The text was updated successfully, but these errors were encountered: