super(A, B) への呼び出しが次の要件を満たさない場合に報告します。
B が A のインスタンスであるB が A のサブクラスである例:
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 は Rectangle のインスタンスまたはサブクラスではありません
この問題は、Square を Rectangle クラスのインスタンスにすることで解決できます。