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

18 lines
629 B
HTML

<html>
<body>
<p>Reports cases when the first parameter,
such as <code>self</code> or <code>cls</code>, is reassigned in a method.
Because in most cases, there are no objectives in such reassignment, the
IDE indicates an error.</p>
<p><b>Example:</b></p>
<pre><code>
class Account:
def calc(self, balance):
if balance == 0:
self = balance
return self
</code></pre>
<p>As a fix, you might want to check and modify the algorithm to ensure that reassignment is needed. If everything is correct,
you can invoke intention actions for this code and opt to ignore the warning.</p>
</body></html>