"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: >>> Sometime it maybe a waste to generate all possible combinations of >>> i,j first. >> >> It doesn't; read about generator expressions at >> http://www.python.org/dev/peps/pep-0289/ >> >> George >> > Thanks, I didn't realize that. > > However, I still think labeled break and continue is a valuable > feature, which is easier to understand and to use. > Can you come up with a realistic example where you think a labelled break would be easier to understand and use? A concrete example would really help if you hope to persuade anyone that your way is better.
I find that Python's ability to extract the control part of a loop into a generator is an extremely powerful way to make loops much clearer for several reasons: you separate completely the 'what we are looping over', and 'when do we stop' from the 'what do we then do with each item'; also you have an opportunity to give the code controlling the loop a separate (and meaningful) name. -- http://mail.python.org/mailman/listinfo/python-list