[Python-ideas] PEP 315: do-while

Shane Green shane at umbrellacode.com
Fri Jun 28 01:34:06 CEST 2013


I actually meant to say the reason the idea has gotten some legs...  :-)   By “legs” I meant lively discussion...




On Jun 27, 2013, at 12:21 PM, Shane Green <shane at umbrellacode.com> wrote:

> Opinions about break statements are really irrelevant, IMHO.  The reason this idea hadn’t taken legs isn’t because of concern about abiding by educators’ blanket rules.  
> 
> List comprehensions are concise, intuitive, and efficient; proper use can improve readability *and* performance significantly.  
> 
> The number of proper applications is limited by list comprehension limitations.  Adding the ability to configure termination in the comprehension will increase that number.
> 
> 
> On Jun 27, 2013, at 7:48 AM, jimjhb at aol.com wrote:
> 
>> 
>> 
>> -----Original Message-----
>> From: Joshua Landau <joshua.landau.ws at gmail.com>
>> To: jimjhb <jimjhb at aol.com>
>> Cc: Andrew Barnert <abarnert at yahoo.com>; python-ideas <python-ideas at python.org>
>> Sent: Thu, Jun 27, 2013 9:35 am
>> Subject: Re: [Python-ideas] PEP 315: do-while
>> 
>> On 27 June 2013 14:26,  <jimjhb at aol.com> wrote:
>> > Andrew,
>> >
>> > I'm not doubting what you are saying, but I am informing the python
>> > community of the reality out there.  Say what you will, but Python's
>> > lack of gotos (if they are bad, then one can just avoid them, right?) is a
>> > form of social engineering on Python's part as well.  I think that's
>> > a good decision, but one can see how social engineering of programmers can
>> > go awry as well.  (MISRA-C 2012 now allows for limited gotos, so times
>> > change.)
>> >
>> > If I take the viewpoint of the no break/continue folks, they have a point.
>> > They can often be avoided, and throwing them in (a lot) is often a sign of
>> > sloppy code.  Breaks (especially) are very easy to avoid with the C for,
>> > because the conditional is explicit and can easily be expanded.  So for C,
>> > educating folks with these rules don't really have much net effect.
>> >
>> > The PROBLEM is that you can't do that with a Python for.  So all this rule
>> > indoctrination is much more consequential (to the code).
>> >
>> > If can argue that adding a conditional SHOULDN'T be necessary, but that
>> > might not reflect our current practical reality.
>> 
>> As the rest of us have said, this is irrelevant.
>> 
>> These people you know are not the norm and no-one is going to budge
>> for them. That's it; and no matter how much you reiterate this is not
>> going to convince even those people who like your suggestion (of which
>> I am not one). Please, just let this point rest.
>> ===================
>> Joshua,
>> 
>> 
>> 
>> You make a good point.  I have no idea how prevalent the problem really is, and that's obviously relevant.  (I haven't taken any polls, and neither have you.)  Bottom line is most other languages allow early termination of for loops without breaking out of them.  Python does not.
>> 
>> _______________________________________________
>> Python-ideas mailing list
>> Python-ideas at python.org
>> http://mail.python.org/mailman/listinfo/python-ideas

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


More information about the Python-ideas mailing list