property-with-parameters
only cares about non-self
parameters if they're positional-or-keyword parameters
#9584
Labels
False Negative 🦋
No message is emitted but something is wrong with the code
Help wanted 🙏
Outside help would be appreciated, good for new contributors
Needs PR
This issue is accepted, sufficiently specified and now needs an implementation
Milestone
Bug description
Pylint's
property-with-parameters
rule checks for@property
-decorated functions that have non-self
parameters, on the grounds that additional parameters in a property function can never be used. However, the check currently only seems to care about additional parameters if they are positional-or-keyword parameters. The check does not emit any violations for additional positional-only parameters, additional keyword-only parameters, additional variadic positional parameters, or additional variadic keyword parameters. This seems off to me: defining those additional parameters is just as strange/incorrect as defining additional positional-or-keyword parameters.To illustrate, only the
a
property in the following example triggers anR0206
violation, whereas I would expectR0206
to be emitted ona
,b
,c
,d
ande
:This means that
R0206
is not actually emitted on the motivating example originally given for this check in #3006 (comment), since that example has an additional variadic keyword parameter (**kwargs
).Command used
Pylint output
Expected output
Pylint version
OS / Environment
MacOS
Additional dependencies
None
The text was updated successfully, but these errors were encountered: