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

27 lines
666 B
HTML

<html>
<body>
<p>Reports cases when any call to <code>super(A, B)</code> does not meet the
following requirements:</p>
<ul>
<li><code>B</code> is an instance of <code>A</code></li>
<li><code>B</code> a subclass of <code>A</code></li>
</ul>
<p><b>Example:</b></p>
<pre><code>
class Figure:
def color(self):
pass
class Rectangle(Figure):
def color(self):
pass
class Square(Figure):
def color(self):
return super(Rectangle, self).color() # Square is not an instance or subclass of Rectangle
</code></pre>
<p>As a fix, you can make the <code>Square</code> an instance of the <code>Rectangle</code> class.</p>
</body>
</html>