I have created a Common class that will be used in common and am approaching from the A function and B function.
If I add variables to the Common class, you must deploy both A and B classes.
How can I apply the Common class take effect without deploy all the A and B functions?
class Common:
def __init__(self, tmp):
self.FIRST = tmp
self.SECOND = 'Test' # new.
# I want to modify this function.
# but I have to deploy function A and B.
# If I have a lot of functions I need a lot of time.
def print_value(self):
print(self.FIRST) # old.
print(self.FIRST, self.SECOND) # new.
class A:
def __init__(self):
o = Common('A')
o.print_value()
class B:
def __init__(self):
o = Common('B')
o.print_value()