[Python-ideas] for/else syntax

Stephen J. Turnbull stephen at xemacs.org
Sat Oct 3 17:34:18 CEST 2009


Since we're voting,

Yuvgoog Greenle writes:

 > I'd like to hear if people like this idea and if so, which of the 2
 > options do you like better.

-1 on both.  In one liners (ie, comprehensions and generator
expressions) I think "for ... if" is readable, but it means something
else!

 > Also, now that the syntax is generic, you can add on to it whatever
 > you like.

With the wind chill factor, -2.

The only other syntax I've seen so far that makes any sense to me at
all is

    for x in xs:
        # suite containing break
    then:
        # suite to execute after processing all xs

but that would require a new keyword, so that's -1, too.



More information about the Python-ideas mailing list