Sometimes I find myself writing code like this:
def analyse(somedata): result = bestapproach(somedata) if result: return result else:
If the number of functions is not too high, why not use the or operator ?
or
d = 'somedata' result = f1(d) or f2(d) or f3(d) or f4(d)
It will only apply the functions until one of them returns something not False.
False