Skip to content
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 when using ndarray.reshape with separate arguments for each element of the shape #7883

Open
ntraut opened this issue Dec 1, 2022 · 2 comments · May be fixed by pylint-dev/astroid#1999
Labels
False Positive 🦟 A message is emitted but nothing is wrong with the code Lib specific 💅 This affect the code from a particular library Needs astroid Brain 🧠 Needs a brain tip in astroid (then an astroid upgrade)

Comments

@ntraut
Copy link

ntraut commented Dec 1, 2022

Bug description

# pylint: disable=missing-docstring
x = np.zeros(12)
x.reshape(3, 2, 2, order='F')

Configuration

No response

Command used

pylint a.py

Pylint output

************* Module src.a
a.py:4:0: E1121: Too many positional arguments for method call (too-many-function-args)
a.py:4:0: E1124: Argument 'order' passed by position and keyword in method call (redundant-keyword-arg)

------------------------------------------------------------------
Your code has been rated at 0.00/10 (previous run: 0.00/10, +0.00)

Expected behavior

no error reported, the syntax is correct as documented here

Pylint version

pylint 2.14.5
astroid 2.11.7
Python 3.9.13 | packaged by conda-forge | (main, May 27 2022, 17:00:33) 
[Clang 13.0.1 ]

OS / Environment

macOS 12.6

Additional dependencies

numpy @ file:///private/var/folders/.../croots/recipe/numpy_and_numpy_base_1652801688716/work

@ntraut ntraut added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label Dec 1, 2022
@Pierre-Sassoulas Pierre-Sassoulas added Needs astroid Brain 🧠 Needs a brain tip in astroid (then an astroid upgrade) False Positive 🦟 A message is emitted but nothing is wrong with the code Lib specific 💅 This affect the code from a particular library and removed Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Dec 1, 2022
@clavedeluna clavedeluna linked a pull request Jan 31, 2023 that will close this issue
@zhcui
Copy link

zhcui commented Nov 5, 2023

Any update on this? Thanks. The false positive still exists.

@Pierre-Sassoulas
Copy link
Member

Hello @zhcui as you can see, there's a merge request opened in astroid : pylint-dev/astroid#1999. If you want to take it over it would probably speed up the resolution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
False Positive 🦟 A message is emitted but nothing is wrong with the code Lib specific 💅 This affect the code from a particular library Needs astroid Brain 🧠 Needs a brain tip in astroid (then an astroid upgrade)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants