Ternary Operator in Python

Terry Reedy tjreedy at udel.edu
Fri Apr 1 18:27:48 EST 2005


"Carl Banks" <invalidemail at aerojockey.com> wrote in message 
news:1112391650.018826.274970 at l41g2000cwc.googlegroups.com...
>> A unary operator has one operand; a binary operator has two operands;
>> ternary operator has three operands.  Python has none built-in,
>
> Not so fast, my friend.  What about the expression "0.0 < a < 1.0"?

Gee, what about 0.0 < a < 1.0 < b < 2.0?  I see both as synthesized 
multinary operators, but your are right in that this combination does act 
differently than a+b+c.

Terry J. Reedy







More information about the Python-list mailing list