I have 4 classes with several methods in each of them. I need these methods to use some class variables as arguments, eg.
class Orange:
def __init__(self,banana):
self.banana = banana
def apple(self,fruit=self.banana):
return something
I already found out that this does not work as method arguments are defined when function is created, not when it is called, so i found a workaround here:
def apple(self,fruit=None):
if fruit is None:
fruit = self.banana
But the problem is, that i have about 50 arguments (no in each method, but summary from all methods of all classes) and using this method, i would get about one hundred new lines of code and that seems to me like very "dirty" workaround... isnt there any easier way how to reach that?