I have a python class, and a parent class.
class A:
def foo(self, num):
num1 = num + 3
print(num1)
class B(A):
def foo(self, num):
super().foo(num)
num2 = num1+3
print(num2)
Is it possible so the child's method to keep the varables from the parents method, when it calls it in super().food(num)to use later in its own version of the method.
Or is there a better way to append to your copy of a parents method?
EDIT: My actual classes are much more complex than this. I just used this as an example. I am making an IRC bot, and wanted a base object, that the other bots could be based on. (Hence some methods will have added parts in some bots)