In C, I would do this:
int i; for (i = 0;; i++) if (thereIsAReasonToBreak(i)) break;
How can I achieve something similar in Python?>
def infinity(): i=0 while True: i+=1 yield i for i in infinity(): if there_is_a_reason_to_break(i): break