I have this Button class derived from pygame.Rect:
class Button(pg.Rect):
def __init__(self, left, top, width, height, char):
super().__init__(left, top, width, height)
self.char = char
def draw_rect(window):
pg.draw.rect(window, pg.Color("red"), "rectobject")
pg.draw.rect takes Rect object as a third argument. So I'm wondering if super() method instantiates the object of the parentclass and if so how to reference it (as we use self for class). I know this is a trivial problem but I'm interested in how these things work in Python. Thanks in advance!