On Wed, 14 Mar 2007, Kent Johnson wrote: > This has already been discussed on this thread. == and 'in' are comparisons.
Aha. I did not see this discussion in the thread; the closest thing I noticed was Alan's note that I was riffing from, which concluded with "It definitely seems to work as I explained it but how it works is defeating my befuddled brain right now." Looking through the archives, I now find your note. > (c == c in 'crab') > means > (c == c) and (c in 'crab') > > http://docs.python.org/ref/comparisons.html Thanks. My take-away from this is that comparisons (including "in", which would not have intuitively struck me as a comparison) don't have precedence rules, so that you can chain them. It just looks odd to chain an "==" with an "in", but I guess it's legal. _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor