-
-
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
Incorrect number of arguments reported when function is imported over #3675
Comments
The issues appears to be caused by changes introduced in commit 01dfa52 to safe_infer in pylint/checkers/utils.py to address #2503. This appears to be because the safe_infer only checks the types of the nodes are the same. In this case they are both functions which is good enough to pass this test but they are functions which take different numbers of arguments and so there is ambiguity about which one to use. |
Thank you for opening the issue and for the analysis. |
Thank you. As the original title might suggest, I encountered this by running pylint on the following code:
This is because networkx uses this trick to import |
temporarily disabling pylint as it has an active bug for two lines: pylint-dev/pylint#3675
* happy pylint (newly added linter) Now to iterate over a `dict`, the only acceptable way is two call `.items()` * disable pylint for two lines due to bugs temporarily disabling pylint as it has an active bug for two lines: pylint-dev/pylint#3675 * fix typo * happy pylint warnings * Happy pylint recoms * fix typo
…arguments differ
…arguments differ
…arguments differ
…arguments differ
…when number of arguments differ (#5409) Co-authored-by: Daniël van Noord <[email protected]>
Steps to reproduce
other_file.py
containing:Current behavior
Pylint reports that line 12 was passed "too many positional arguments for function call (too-many-function-args)"
Expected behavior
Pylint should not report an issue since within this if statement tmp refers to the imported function which can be called with two arguments.
pylint --version output
pylint 2.5.2
astroid 2.4.1
Python 3.8.2 (default, Apr 27 2020, 15:53:34)
[GCC 9.3.0]
The text was updated successfully, but these errors were encountered: