i want to to pass class method as and a default argument to another class method, so that i can re-use the method as a @classmethod
@classmethod
class foo:
def func1(self,x):
do somthing;
def func2(self, aFunc = self.func1):
# make some a call to afunc
afunc(4)
this why when the method func2 is called within the class aFunc defaults to self.func1, but i can call this same function from outside of the class and pass it a different function at the input.
i get
NameError: name 'self' is not defined
for those who want more detail:
so here is my setup
class transmissionLine:
def electricalLength(self, l=l0 , f=f0, gamma=self.propagationConstant,deg=False):
but i want to be able to call electricalLength with a different function for gamma, like
transmissionLine().electricalLength (l,f,gamma=otherFunc)