False positive on decorators that return a staticmethod
#7300
Labels
False Positive 🦟
A message is emitted but nothing is wrong with the code
Needs PR
This issue is accepted, sufficiently specified and now needs an implementation
Milestone
Bug description
In some usecases, a decorator is applied to a method of a python class, and it returns a staticmethod instead. Those usecases are supported by mypy with a
TYPE_CHECKING
guard: python/mypy#6726 (comment).However, testing with pylint, an error pops up indicating
self
is not the first argument of the method above. Additionally, even if we are not using theTYPE_CHECKING
guard, pylint does not seem to propagatestaticmethod
decorator:Ideally, if pylint propagates
staticmethod
throughmy_decorator
, the false positive would go away.Thanks in advance!
Configuration
Configuration is not relevant
Command used
Pylint output
Expected behavior
Expected that pylint propagates
staticmethod
viamy_decorator
so that the snippets below will work without warning:Pylint version
OS / Environment
Ubuntu 20.04
Additional dependencies
N/A
The text was updated successfully, but these errors were encountered: