@staticmethod
PYL-R020120
21
22class Linter(BaseLinter): # type: ignore
23 def allow(self, path: str) -> bool:24 """Determine if this path should be linted."""
25 return path.endswith(".py")
26
The method doesn't use its bound instance. Decorate this method with @staticmethod
decorator, so that Python does not have to instantiate a bound method for every instance of this class thereby saving memory and computation. Read more about staticmethods here.