On Sat, Oct 17, 2009 at 10:22 PM, StarWing <weasley...@sina.com> wrote: > okay, I think somethings do....while is useful, but why python didn't > have it?
For simplicity of syntax and less duplication among the basic syntactic constructs. > in lisp, we can (while (progn ....)) > and in all other language we have do...while. > but in python, we only can: > cond = 1 > while cond: > cond = 0 > ..... > if ....: cond = 1 > > has any polite way to handle this? It's essentially the same: while True: ... if not cond: break This is considered idiomatic; and FWIW, I see do-while as having no significant advantage over this. Cheers, Chris -- http://blog.rebertia.com -- http://mail.python.org/mailman/listinfo/python-list