
16 Jul
2009
16 Jul
'09
1:49 p.m.
Steven D'Aprano wrote:
On Thu, 16 Jul 2009 08:50:06 am Jan Kaliszewski wrote:
Hello,
The issue has been coming back repeatedly:
And not very long ago at that.
So often that there's even a PEP* that documents the pros and cons of different ideas and points out that a viable syntactic challenger to the "while True with inner break" approach has yet to be found.
The current idiom does have the downside of potentially hiding the termination condition, but it otherwise handles generalised looping very nicely. (Putting the break on a separate line also helps a great deal with the visibility of the termination condition)
Cheers, Nick.
* http://www.python.org/dev/peps/pep-0315/
--
Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia
---------------------------------------------------------------