1.super
需要加()
例:
class Rectangle():
def __init__(self, x1, y1, x2, y2):
self.x1 = x1
self.y1 = y1
self.x2 = x2
self.y2 = y2
继承
class Square(Rectangle):
def __init__(self, x1, y1, length):
self.x1 = x1
self.y1 = y1
self.x2 = x1 + length
self.y2 = y1 + length
super().__init__(self.x1, self.y1, self.x2, self.y2)