mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-29 16:02:32 +07:00
GitOrigin-RevId: 56876a5dd073a06c3fcc92f63ed1f5674830bc25
27 lines
666 B
HTML
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> |