"Kay Schluehr" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > No, as I explained it is not a ternary operator and it can't easily be > implemented using a Python function efficiently because Python does not > support lazy evaluation.
By *carefully* using the flow-control operators 'and' and 'or', you can often get what you want *now*, no PEP required. > One usually does not want to evaluate all > conditions as well as all the results ( when passing them into the > function ) but evaluate conditional expressions sequentially and stop > at the first true condition. *If* bool(result_expression_i) == True for all i, (except maybe last default expression), which is true for some actual use cases, then the following expression evaluates to the result corresponding to the first 'true' condition (if there is one) or to the default: c0 and r0 or c1 and r1 or c2 and r2... or default. I have only seen real examples with one and-pair, like (x < 0) and -x or x for absolute value. Terry J. Reedy -- http://mail.python.org/mailman/listinfo/python-list