I'm using to his code to flatten nested tuples:
def get_tuple_leaves(t, out=[]):
for i in t:
if isinstance(i, str):
yield i
else:
get_tuple_leaves(i, out)
The idea is to get an input such as (('a', 'b'), 'c') to turn to ('a', 'b', 'c')
But for some reason the recursive call never gets executed, and the output is ('c')