def until(pred):
    yield None
    while True:
        if pred(): break
        yield None

def example():
    i = 0
    for _ in until(lambda: x==0):
        x = 10 - i
        i += 1
        print x, i

example()

Attachment: pgpeP7iW6mcQm.pgp
Description: PGP signature

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to