I was building several classes, and those class and its method need to be passed by method from another class.
class SimplePlotGenerator:
def __init__(self):
self.phrase = 'Something happens'
def generate(self):
return self.phrase
and here another class should do.
pv = PlotViewer()
pv.register(SimplePlotGenerator())
pv.generate()
'Something happens'
I have two more class for the PlotGenerator.
My question is how to build that register method. I think it might be some sort of multiple inheritances but I kind of stuck there.