[Python-ideas] Automatic total ordering

Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Wed Oct 15 23:07:27 CEST 2008


2008/10/15 Arnaud Delobelle <arnodel at googlemail.com>:

>> Partial orderings are certainly used, but I believe they are far less
>> common than total ones. Regardless, a partially ordered class has to
>> explicitly define the supported methods with the desired semantics anyway;
>> the proposed change wouldn't make this any harder.
>
> I don't understand.  In a mathematical ordering,
>
> * x > y means the same as y < x
> * x <= y means the same as x < y or x = y
> * x >= y means the same as x > y or x = y
>
> and this is irrespective of whether the ordering is partial or total.

But for a total ordering 'not y < x' is a more efficient definition of
'x <= y' than 'x < y or x == y'.

-- 
Marcin Kowalczyk
qrczak at knm.org.pl
http://qrnik.knm.org.pl/~qrczak/



More information about the Python-ideas mailing list