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

Some numpy top-level funcs are not ignored even with ignored-modules=numpy set #3736

Closed
igozali opened this issue Jul 11, 2020 · 3 comments
Closed

Comments

@igozali
Copy link

igozali commented Jul 11, 2020

Steps to reproduce

  1. Create pylintrc file with the following content
[TYPECHECK]
ignored-modules=numpy
  1. Create test.py
import numpy as np
xs = np.array([1, 1, 2])
np.unique(xs, return_index=False)
  1. Run pylint:
pylint --rcfile=./pylintrc -E test.py

Current behavior

igozali@abcdef $ pylint --rcfile=./pylintrc -E test.py
************* Module test
test.py:3:0: E1123: Unexpected keyword argument 'return_index' in function call (unexpected-keyword-arg)

Expected behavior

No errors since the module numpy is supposed to be ignored.

pylint --version output

igozali@abcdef $ pylint --version
pylint 2.5.3
astroid 2.4.2
Python 3.6.4 |Anaconda, Inc.| (default, Mar 13 2018, 01:15:57)
@igozali
Copy link
Author

igozali commented Jul 11, 2020

Checked preview versions and didn't find any newer ones than the above version.

Seems related? #3135

Also the generated-members trick didn't help since np.unique isn't generated...

@igozali
Copy link
Author

igozali commented Jul 11, 2020

Another data point, downgrading to pylint==2.3 seems to make it work.

@AWhetter
Copy link
Contributor

ignored-modules will disable member checks on the module. It does not disable all checks associated with that module.
This looks like an issue with pylint not being able to understand that np.unique() takes a return_index keyword argument. This is already covered in #3825 so I'm closing in favour of that issue instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants