Ternary Operator in Python

Carl Banks invalidemail at aerojockey.com
Fri Apr 1 20:04:05 EST 2005


Terry Reedy wrote:
> "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.

It seems that Python has an infinite number of operators.


-- 
CARL BANKS




More information about the Python-list mailing list