I want my Board
class to inherit from my Cell
class. My Cell
class accepts 3 parameters in it's __init__
function but I do not want that in the __init__
function in my Board
class. Is it possible to do something like this?
class Board(Cell):
def __init__(self):
super().__init__(x, y, w)
self.x = x
self.y = y
self.w = w
instead of doing this:
class Board(Cell):
def __init__(self, x, y, w):
super().__init__(x, y, w)
self.x = x
self.y = y
self.w = w
My goal is to make a 2d array called self.board inside of Board class.
self.board = [[Cell(i * w, j * w, w) for i in range(3)] for j in range(3)]
. Because of this I do not want to inherit the arguments from the cell class, because when I call the Board class I want to create it without any arguments.