def my_recursive_function(x, y, depth=0, MAX_DEPTH=20):
if depth > MAX_DEPTH:
return exhausted()
elif something(x):
my_recursive_function(frob(x), frob(y), depth + 1)
elif query(y):
my_recursive_function(mangle(x), munge(y), depth + 1)
else:
process(x, y)
my_recursive_function(a, b)
my_recursive_function(a, b, MAX_DEPTH=5)
my_recursive_function(a, b, MAX_DEPTH=1e9)
user79758
source
share