Disable a warning when using specified decorator(s)
I have a custom decorator which, like the @classmethod
decorator, wraps the target method in such a way that it expects the type of the parent class rather than a class instance (cls
vs self
).
I understand that it is not likely that PyCharm would be able to unpack and interpret what my decorator is doing, so instead what I would like to do is disable the “Usually first parameter of a method is named 'self'” warning specifically for methods decorated with my decorator.
I can just disable it altogether, but I'd like to keep it just in case it catches something i miss, and I'd like to avoid littering my code with # noinspection PyMethodParameters
请先登录再写评论。