conditional expressions

Greg Ewing see_reply_address at something.invalid
Thu Sep 26 18:54:55 EDT 2002


Peter Hansen wrote:

> If nothing else, it fails the test of Least Surprise.
> You have to stop and think "does the conditional test *really*
> lie in the middle of this expression?".


I think you're misapplying Least Surprise here.
If you actually read it, then it means just what
it says. If it meant something *other* than what
it says, that would be a violation of Least Surprise.

>>I, personally, read this as 'take a if b is true else take c' which
>>corresponds to 'b? a: c' in C.
>>
> Surely that's exactly what he meant?


Yes! You just have to train yourself to believe
your eyes. :-)

-- 
Greg Ewing, Computer Science Dept,
University of Canterbury,	
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg




More information about the Python-list mailing list