[Python-Dev] PEP-xxx: Unification of for statement and list-comp syntax

Niko Matsakis niko at alum.mit.edu
Mon May 22 10:07:27 CEST 2006


> I saw them. Your brain must be wired very differently
> to mine, because I find loops with a continue in them
> harder to follow than ones without -- exactly the
> opposite of what you seem to prefer.

Delurking for no particular reason:

For what it's worth, I also favor the continue syntax Heiko compared  
his code against.  Without it, you have to scroll to the end of the  
loop to know whether  there is an else clause; it also allows you to  
have multiple conditions expressed up-front without a lot of  
indentation.  In general, I favor the idea that the main flow of  
computation should have the least indentation.  I also am +1 on this  
PEP, even if it is doomed, as I've often longed to use list- 
comprehension like syntax in a for loop; to me it is mentally taxing  
to remember which syntax is supported where.

Just thought I'd throw Heiko some support. :)


Niko


More information about the Python-Dev mailing list