Defending the ternary operator

Aahz aahz at
Sat Feb 8 23:32:54 CET 2003

In article <yu991y2iae1a.fsf at>,
Andrew Koenig  <ark at> wrote:
>Alexander> I think you're missing one important aspect:
>Alexander> predicatability of the sort that syntatic uniformity buys
>Alexander> you. That is because it allows you to parse larger chunks,
>Alexander> e.g. you always know that when you run into the token "if"
>Alexander> the context is as follows: ``if CONDITION: DO_SOMETHING
>Alexander> ...``.
>This claim is already not true:
>        y = [i for i in x if i != 0]

That's a limited counter-claim because of the brackets setting off the
listcomp.  It's also further limited by the functionality available to
the if.
Aahz (aahz at           <*>

Register for PyCon now!

More information about the Python-list mailing list