Recursion done inside of a variable
I am a bit confused on how the compiler does recursion if it is in a variable. The only way to easily explain the question is if I show an example. def recur_var(s1, s2): '''Test for recursion in variables.''' if s1 == '': return s2 elif s2 == '': return s1 else: test = recur_var(s1[:-1], s2[:-1]) if s1[-1] == '1' and s2[-1] == '1': return True return test The only recursion done in the above code is inside the variable that is above in priority over everything else, besides base cases. I realize this code is all over the place in terms of what it does, but my question is, in the trace of this