class Quad:
def __init__(self, *vals):
self.x = [vals[0], vals[1]]
self.y = [vals[2], vals[3]]
@property
def matrix(self):
return [self.x, self.y]
class Rect(Quad):
def __init__(self, width, height):
self.x = [0, width]
self.y = [0, height]
# meta decorations
@property
def area(self):
return (self.x[1] - self.x[0]) * (self.y[1] - self.y[0])
# Meta addition
def width(self):
return self.x[1] - self.x[0]
Rect.width = width