Yet Another Switch-Case Syntax Proposal

Chris Angelico rosuav at gmail.com
Fri Apr 4 00:20:06 EDT 2014


On Fri, Apr 4, 2014 at 2:13 PM, Ethan Furman <ethan at stoneleaf.us> wrote:
> On 04/03/2014 08:09 PM, Chris Angelico wrote:
>>
>> On Fri, Apr 4, 2014 at 1:04 PM, MRAB <python at mrabarnett.plus.com> wrote:
>>>
>>> I thought [continue] went to the end of the loop, but because it's a
>>> loop, it
>>> just wraps around back to the top...
>>
>>
>> It goes to the bottom of the loop, and then the loop condition may or
>> may not send it to the top of the loop.
>
>
> *ahem*
>
> The loop condition is *at* the top of the loop;  if it was at the bottom it
> would be a do..until.  ;)

Well, if you go by the disassembly, Python does put the condition at
the top of the loop. But I've seen plenty of C compilers that invert
that - before the top of the loop it jumps down to the bottom, the
bottom has the condition, and the condition may or may not jump you up
to the top of the loop.

Semantics :)

ChrisA



More information about the Python-list mailing list