def f(xs): found = False for x in xs: yield x found = True print(found)