test.py
import numpy as np
x = np.fromfile('hello.npy')
x.reshape((1, 5))
pylint test.py
test.py:3:6: E1121: Too many positional arguments for method call (too-many-function-args)
too-many-function-args
No error
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)]
Hi @jwkvam
What version of numpy do you have? Locally using the same pylint and Python version, I'm not getting the error, getting instead:
************* Module a
a.py:1:0: C0111: Missing module docstring (missing-docstring)
a.py:2:0: C0103: Constant name "x" doesn't conform to UPPER_CASE naming style (invalid-name)
After some further debugging it seems this is only triggered with:
extension-pkg-whitelist=numpy
in my pylintrc. I've tried this with numpy 1.14.5 and 1.15.0. I forget why I whitelisted numpy in the first place, it was likely years ago. I don't know if this is still a bug :/
Thanks, now I can also reproduce it with extension-pkg-whitelist.
Hi,
Same kind of behaviour with :
import numpy as np
np.timedelta64(10, 'ms')
I also have extension-pkg-whitelist=numpy in my pylintrc, due to all the no-member errors that pylint generated at the time for numpy (I haven't checked if these errors are still there).
Thanks !
For me I get E1121: Too many positional arguments for constructor call (too-many-function-args) for date = np.datetime64("2018-01-14", "D") even with an empty .pylintrc. Versions are:
$ pylint --version
pylint 2.2.2
astroid 2.1.0
Python 3.7.2 (default, Jan 10 2019, 23:51:51)
[GCC 8.2.1 20181127]
and numpy 1.15.4
I can confirm that using:
one_day = np.timedelta64(1, 'D')
results in E1121: Too many positional arguments for constructor call (too-many-function-args)
I have no .pylintrc and have the following versions:
pylint 2.2.2
astroid 2.1.0
Python 3.6.6
numpy 1.15.4
Same here: np.timedelta64(1, 'D)
pylint 2.2.2
astroid 2.1.0
Python 3.6.1
numpy 1.15.1
It might be something similar to what causes PyCharm to misinterpret skeletons for numpy.
https://youtrack.jetbrains.com/issue/PY-23521
I'm also seeing this issue with np.timedelta64(1, "D") and
astroid 2.2.2
numpy 1.15.1
pylint 2.3.0
python 3.6.8
Same problem for me with np.timedelta64(1,'D'): "too many positional arguments"
astroid 2.2.5
numpy 1.16.2
pylint 2.3.1
python 3.7.2
I still see this in
pylint
astroid 2.3.3
Python 3.7.3 (default, Dec 29 2019, 20:14:33)
[GCC 9.2.1 20191130]
>>> numpy.version.version
'1.18.2'
This is a helpful tool. Thank you.
FYI - I'm getting this error with the following versions:
pylint 2.5.3
astroid 2.4.2
Python 3.7.3 (default, Jun 2 2020, 13:01:47)
[Clang 11.0.3 (clang-1103.0.32.59)]
numpy: 1.15.0
- E
@EdmundsEcho @waiyip-aquabyte i'm unable to reproduce the bug with an astroid version >= 2.3.3.
Most helpful comment
I can confirm that using:
results in
E1121: Too many positional arguments for constructor call (too-many-function-args)I have no
.pylintrcand have the following versions: