ternary operator

Laura Creighton lac at strakt.com
Tue Feb 4 19:00:18 EST 2003


My gloss is:  Current consensus is that the ternary
operator only very rarely produces code that is easier to understand
and read.  Very, very, very, rarely.

The rest of the time it just adds to the perceptual/conceptual load of
the person who is reading it.

In Python, the decision was made that it was better to let the people
read easily, rather than give them hard tough conceptual loads, which
only the well studied will understand.  this newsgroup is not
reflective of it, because it is where those who like archana hang out
and write things that are hard to understand for the joy of doing
something difficult.  Workday python is easier to read.

And the ternary operator flunks the 'worth the conceptual overload'
test.  Therefore do not expect to see it soon.

---------

Note: I do not speak for a single member of python-dev.  watch them
put a ternary in 2.4 all oblivious of my annoyance.  This is just what
i have gleaned from discussions here, and the fact that there is no
ternary operator yet, despite years of some people wanting it.

Laura





More information about the Python-list mailing list