PEP308 - preference for 'x if c else y' over 'c then x else y'

Erik Max Francis max at alcyone.com
Sat Feb 15 09:54:56 CET 2003


Stephen Horne wrote:

> You seem to be preoccupied with the order of evaluation - the fact
> that the condition must be evaluated first, whereas only one of the
> values to select from is evaluated at all.

I'm not "preoccupied" with it, I just think it impairs understanding. 
If you've also been reading these threads, you'd see that this was a
wide-reaching objection, penetrating both pro- and anti-PEP camps.  Lots
of people objected to it, not just me.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ No one should have to dance backward all their lives.
\__/ Jill Ruckelshaus
    WebVal / http://www.alcyone.com/pyos/webval/
 URL scanner, maintainer, and validator in Python.




More information about the Python-list mailing list