I am implementing a recursive algorithm:
def induct(arg):
if doStuff(arg) == 0:
return # Completely stop algorithm, go home.
induct(doStuff(arg))
The problem is that return will only return the current call of induct. Is there a way to return all induct calls to completely halt the algorithm?
Raise an exception instead of return.