Open
Description
Bug description
As mentioned in merge-request 8674 comment, self
is counted as one of the arguments in the too-many-arguments
calculation.
This means that if a user creates a function with 5 parameters, the message is not emitted whereas if the user creates a method with the same 5 parameters, then the message will be emitted. This behaviour could be surprising.
No message emitted:
def name1(param1, param2, param3, param4, param5):
...
Message is emitted:
class A:
def name2(self, param1, param2, param3, param4, param5): # R0913: Too many arguments (6/5) (too-many-arguments)
...
Configuration
No response
Command used
pylint example.py
Pylint output
R0913: Too many arguments (6/5) (too-many-arguments)
Expected behavior
No message emitted for this example
Pylint version
pylint 3.0.0b1
astroid 3.0.0a2
Python 3.10.4
OS / Environment
No response
Additional dependencies
No response