Newcomer struggling with tutorial
Terry Reedy
tjreedy at udel.edu
Sun Oct 5 16:57:22 EDT 2003
"CPK Smithies" <cpks at NOspam.btopenwhirled.com> wrote in message
news:blpf2k$fef$1 at titan.btinternet.com...
> What I found so disturbing is that
> a < b == c
> is not equivalent either to
> (a < b) == c
> nor to
> a < (b == c)
> since (given that for example (a, b, c) == (-1, 77, 1)) the first is
false
> while the latter are both true.
Correct. Chained comparisons, like logical 'and' and 'or' are
convenient 'special forms' (to use the Scheme/Lisp terminology) that
one has to learn if you are to read or write them. I believe all
other operators act as you expect.
Terry J. Reedy
More information about the Python-list
mailing list