Inspectopedia
 
2024.3

Class-specific decorator is used outside the class

Warning
New
Last modified: 03 December 2024

Reports usages of @classmethod or @staticmethod decorators in methods outside a class.

Example:

The change_state method should not use the @classmethod decorator or it should be moved to the State class declaration.

If you apply the Remove decorator action, the code changes to: