True == 1 weirdness

Gregory Ewing greg.ewing at canterbury.ac.nz
Thu Sep 17 02:24:56 EDT 2015


Chris Angelico wrote:
> But are there _any_ comparison operators which
> are unchainable? If not, there's no reason to disallow 'in';

My problem is that I find it difficult to remember that
Python considers 'in' to be a comparison operator.

To me, comparison is something you do between things of
the same kind, whereas 'in' is a relationship between
things of different kinds. Calling it a comparison is
like comparing apples and oranges. Or apples and
baskets of apples, or something.

-- 
Greg



More information about the Python-list mailing list