[Python-ideas] PEP 315: do-while

Andrew Barnert abarnert at yahoo.com
Thu Jun 27 19:51:42 CEST 2013


On Jun 27, 2013, at 9:53, jimjhb at aol.com wrote:

> -----Original Message-----
> From: Ethan Furman <ethan at stoneleaf.us>
> To: python-ideas <python-ideas at python.org>
> Sent: Thu, Jun 27, 2013 12:43 pm
> Subject: Re: [Python-ideas] PEP 315: do-while
> 
> On 06/27/2013 07:48 AM, jimjhb at aol.com wrote:
> >
> > Bottom line is most other languages allow early termination of for loops
> > without breaking out of them.  Python does not.
> 
> If they are terminating early, then they most certainly are breaking out of 
> them, regardless of whether the word 'break' 
> is used.
> Yes, but the control flow (and location of the control) is different.  All this "don't use breaks" stuff can be traced back  to E.W Dijkstra and structured programming.  Structured programming remains in a lot of mindsets today.
Structured programming is all about how to write maintainable programs in a low-level Algol-like language, and that's what C is. But that's not even close to what Python is. People trying to program Python as if it were C are going to write bad Python. Bending over backward to accommodate them will only make things worse.

The best thing we can do is use as many generators as possible--anyone who thinks break doesn't belong in Python will suffer from head-asplode once they finally realize what yield does to control flow, and then they'll no longer be a problem.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130627/8f37f1d0/attachment.html>


More information about the Python-ideas mailing list