[Python-Dev] non-binary operators
Gerald S. Williams
gsw@agere.com
Mon, 17 Feb 2003 10:10:18 -0500
Gary Herron wrote:
> Good point. I've never actually used (a<b<c), but I'm pleasently
> surprised when reminded of it's existence. There is however a
> difference. A whole string of '<' operators (or even of string of
> mixed '<' and '>' operators) can be understood by considering each
> operation in isolation as a binary operation.
Trying hard to avoid PEP 308 discussions: :-)
Yes and no. You cannot collapse the expression, so these
binary "operations" are really only partial operations.
Granted, with th*n/el*e the left-most operand participates
in both partial operations, but I'll leave that discussion
to c.l.py. I was just pointing out that there's precedent
for (a OP b OP c) != ((a OP b) OP c) != (a OP (b OP c)).
-Jerry