-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 too-many-function-args for a function defined and called within a class #6592
Comments
Wrote this bug for pylint, because I shouldn't have to add a pragma: pylint-dev/pylint#6592
Wrote this bug for pylint, because I shouldn't have to add a pragma: pylint-dev/pylint#6592 https://nedbat.github.io/coverage-reports/reports/20220512_3e6ff4ff21/htmlcov 3e6ff4ff21: master
Thanks for the report. The behavior changed in pylint-dev/astroid#1531. I think the new result is closer to what pylint does in general, which is to complain when At the very least emitting a lower severity message for this scenario is something to consider. |
Huh, on 3.7-3.9, a staticmethod produces "TypeError: 'staticmethod' object is not callable". On 3.10 it works... |
@nedbat, for < 3.10 class Dyn:
@staticmethod
def _make_method(name):
def _the_method(self):
print(name)
return _the_method
print_nedbat = Dyn()._make_method("nedbat")
print_nedbat(print_nedbat) |
…l is assigned to a class attribute inside the class where the function is defined. Closes pylint-dev#6592
…l is assigned to a class attribute inside the class where the function is defined. Closes pylint-dev#6592
…l is assigned to a class attribute inside the class where the function is defined. Closes pylint-dev#6592
…l is assigned to a class attribute inside the class where the function is defined. Closes pylint-dev#6592
…l is assigned to a class attribute inside the class where the function is defined. (pylint-dev#7395) Closes pylint-dev#6592
Bug description
This code works. But pylint doesn't like it:
Configuration
No response
Command used
Pylint output
Expected behavior
Since the code works, this is not an error. Pylint shouldn't complain.
Pylint version
pylint 2.13.8 astroid 2.11.5 Python 3.7.13 (default, Mar 16 2022, 20:45:04) [Clang 12.0.0 (clang-1200.0.32.29)] (btw, this didn't happen with pylint 2.13.7 and astroid 2.11.3)
OS / Environment
Mac OS 10.15.7
Additional dependencies
No response
The text was updated successfully, but these errors were encountered: