Would there be support for a more general cmp/__cmp__

Antoon Pardon apardon at forel.vub.ac.be
Mon Oct 24 08:04:34 EDT 2005


Op 2005-10-24, Steve Holden schreef <steve at holdenweb.com>:
> Antoon Pardon wrote:
>> 
>>>>>set([1]) <=  set([2])
>> 
>> False
>> 
>>>>>set([2]) <= set([1])
>> 
>> False
>> 
> Set orderingd are explicitly documented as being based on proper 
> subsetting. This is an abuse of the operators to make subset tests more 
> convenient rather than a definition of an ordering.

It *is* a definition of an ordering.

For something to be an ordering it has to be anti symmetric and transitive.

The subset relationships on sets conform to these conditions so it is a (partial)
ordering. Check your mathematic books, Why you would think this is abuse is beyond me.

-- 
Antoon Pardon



More information about the Python-list mailing list