[Python-ideas] copyable iterators, named loops, continue a expression per indentation and a few functional things

David Blaschke dwblas at gmail.com
Tue Dec 26 23:56:17 CET 2006


Using break for parent, grandparent, etc. only works until someone modifies
the code incorrectly.  It is a problem waiting to happen.  Mathias'
suggestion breaks the outer loop, but a slight modification allows you to
break any one of the loops

"Well this is a good way to break the outer most loop without any new
syntax:"
    cond1 = 1
    cond2 = 1
    cond3 = 1
    while cond1:
        while cond2:
           while cond3:
               if cond4:
                   cond2 = 0         ## break second loop, etc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20061226/dfe38099/attachment.html>


More information about the Python-ideas mailing list