FW: [Python-Dev] conditional expressions?

Paul Rubin phr-n2001d at nightsong.com
Tue Oct 16 01:58:13 EDT 2001


Carel Fellinger <cfelling at iae.nl> writes:
> > A conditional expression analogy to list comprehensions would be
> >   x = (a if b else c)
> 
> though I think I like this spelling more, you mixed up a and b, and
> that's probably a likely mistake, so a big disadvantage.  On the other
> hand this clearly looks like an expression to me, a big advantage.

To have the same meaning as the other example, yes.  I should have not
just copied the letters from the other example.

Thinking about it, I like this syntax more too, but since I think
parenthesized S-expressions are the one true syntax, I'm not too fussy
about which imperfect substitute gets chosen ;-).



More information about the Python-list mailing list