I am debugging a Python code and see this code pattern in one of the classes:
def someOtherFunction (x):
return x**2
class baseX():
pass
class baseY():
pass
class newBase (baseX, baseY):
def __init__ (self, **kwargs):
super().__init__(**kwargs)
def func (self, varX):
varA = someOtherFunction(varA)
varB = self(varA)
return varB
I am having a hard time understanding the self()
syntax. What is varB = self(varA)
? What is it doing?
The original code is not my code. The original code is supposed to work. The pseudo-code I wrote is to represent my question better. Please see the original code on Github (Line 101)