Files
openide/python/python-psi-impl/resources/inspectionDescriptions/PyDecoratorInspection.html
Louis Vignier 1869ec9da6 [codeInspection] Fix python inspection descriptions
GitOrigin-RevId: 56876a5dd073a06c3fcc92f63ed1f5674830bc25
2023-04-28 13:13:25 +00:00

34 lines
746 B
HTML

<html>
<body>
<p>Reports usages of <code>@classmethod</code> or <code>@staticmethod</code> decorators
in methods outside a class.</p>
<p><b>Example:</b></p>
<pre><code>
class State(object):
@classmethod
def my_state(cls, name):
cls.name = name
@classmethod
def change_state(self):
pass
</code></pre>
<p>The <code>change_state</code> method should not use the <code>@classmethod</code> decorator or it should be
moved to the <code>State</code> class declaration. </p>
<p>If you apply the <code>Remove decorator</code> action, the code changes to:</p>
<pre><code>
class State(object):
@classmethod
def my_state(cls, name):
cls.name = name
def change_state(self):
pass
</code></pre>
</body>
</html>