I have c class definition and some inner class definitions for that class:
class DoXJob():
def __init__(self, param1, param2):
<choose an inner class to use>
def DoIt(self):
pass
def Finalize(self):
<do finalization>
class DoXInSomeWay():
def __init__(self):
....
....
def DoIt(self):
...
class DoXInSomeOtherWay():
def __init__(self):
....
....
def DoIt(self):
...
Logic is simple, i have some inner class definitions to handle a job, and i call DoXJob
with some parameters, it then decides which inner class will be used, and override DoXJob.DoIt
method with the method of selected inner class method (DoXInSomeOtherWay.DoIt
or DoXInWay.DoIt
)
obj = DoXJob(param1, param2)
obj.DoIt()
All is fine, what i want is to trigger DoXJob.Finalize
from the ineer classes, like calling it from the DoXInSomeOtherWay.DoIt
or DoXInWay.DoIt
. But i do not know how to handle this, and whether is it the right way. Or is it better to make as a DoXJob
method call like:
obj = DoXJob(param1, param2)
obj.DoIt()
obj.Finalize()