[Python-Dev] PEP 207 -- Rich Comparisons

Tim Peters tim.one@home.com
Mon, 18 Dec 2000 13:38:13 -0500


[Paul Barrett]
> ...
> Can someone provide an example in mathematics where comparison
> operators are used in a non-boolean, ie. rich comparison, context.
> If so, this might shut me up!

By my informal accounting, over the years there have been more requests for
three-outcome comparison operators than for elementwise ones, although the
three-outcome lobby isn't organized so is less visible.  It's a natural
request for anyone working with partial orderings (a < b -> one of {yes, no,
unordered}).  Another large group of requests comes from people working with
variants of fuzzy logic, where it's desired that the comparison operators be
definable to return floats (intuitively corresponding to the probability
that the stated relation "is true").  Another desire comes from the symbolic
math camp, which would like to be able to-- as is possible for "+", "*",
etc --define "<" so that e.g. "x < y" return an object capturing that
somebody *asked* for "x < y"; they're not interested in numeric or Boolean
results so much as symbolic expressions.  "<" is used for all these things
in the literature too.

Whatever.  "<" and friends are just collections of pixels.  Add 300 new
operator symbols, and people will want to redefine all of them at will too.

draw-a-line-in-the-sand-and-the-wind-blows-it-away-ly y'rs  - tim