mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
18 lines
629 B
HTML
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>
|