PEP 315: Enhanced While Loop

Andrew Koenig ark at research.att.com
Mon May 5 13:47:01 EDT 2003


Alex> OK.  Makes the semantic of an else clause somewhat peculiar (the else
Alex> clause's body executes if the condition on the FIRST while causes the
Alex> exist, but not if the loop exists because of the condition on any of
Alex> the FOLLOWING while's) but perhaps that's secondary.

Well, maybe.  I hadn't thought of else clauses.  Indeed, that may be
another reason for my proposed syntax, because I would certainly want
the else to execute if the condition of *ANY* of the while clauses
causes the exit (but not if a break causes it).

-- 
Andrew Koenig, ark at research.att.com, http://www.research.att.com/info/ark




More information about the Python-list mailing list