For review: PEP 308 - If-then-else expression

Alex Martelli aleax at aleax.it
Sun Feb 9 14:30:01 EST 2003


Piet van Oostrum wrote:
   ...
> If b is a variable that takes only 0 and 1 as values then
> 
> b -> (x, y) is the same as
> b -> [y, x]
> 
> because with boolean conditionals people are used to have the true clause
> first. And we shouldn't change that.

Argh -- I had missed that.  OK, then I don't like the proposal any
more -- having to switch order of x and y depending on what
parentheses you use would make the construct unusable IMHO, and,
without the generality of being able to use it in the integer
case, I don't think the usefulness is sufficient to warrant a
new operator.  Pity:-(.


Alex





More information about the Python-list mailing list