I am writing a function that calls on several other functions with default arguments. I have been explicitly passing every parameter of the inner functions to the outer function but this has caused the outer function parameter list to become very long. Is there a common way to handle this? Below is an example of what I have been doing and am looking for what is common practice.
class my_class:
def inner1(self, arg1=1, arg2=2):
return (arg1 + arg2)
def inner2(self, arg3=3, arg4=4):
return (arg3 * arg4)
def outer(self, arg5, arg6, arg1=1, arg2=2, arg3=3, arg4=4):
x1 = self.inner1(arg1, arg2)
x2 = self.inner2(arg3, arg4)
x3 = x1 + x2 + arg5 - arg6
return x3
I primarily run the outer function and once in a while I might want to change the input parameters arg1, arg2, arg3, and/or arg4. I don't want to keep such a long list of input parameters to outer. What can be done here? Please provide an example as I am new to programming. Thank you!
What I have tried:
I have tried using __init__ to instantiate the variables but I do not want to modify the object every time I want to change arg1 for example.
I have looked into *args and **kwargs but because these are required function inputs, I am not sure this would work.