[Python-ideas] Automatic comparisons by default

Jason Orendorff jason.orendorff at gmail.com
Tue Mar 15 20:14:28 CET 2011


On Tue, Mar 15, 2011 at 1:47 PM, Guido van Rossum <guido at python.org> wrote:
>> 2. On "<=", if Python doesn't find __le__, use "__eq__() or __lt__()".
>> The same for ">=", of course.
>
> Big -1 for this. Inequalities (orderings) are much more subtle than
> equalities. See e.g. sets.

But "<=" means "< or ==" even for sets. Got another example?

Orderings can be subtle, but it's uncontroversial to say that "≤"
always means "< or =" even for partial orders. (I guess a
mathematician might say instead that "<" means "≤ but not =". They are
weird that way.)

-j



More information about the Python-ideas mailing list