I don't believe it makes sense. This is a manually defined generator and the appropriate way to signal the end of generation is with a ``StopIteration``