Hey Simon and Nils,

On Wednesday, January 23, 2013 2:28:44 PM UTC-8, Simon King wrote:
>
> Hi! 
>
> At #13991, we try to fix a speed regression that comes from the fact 
> that Partitions(n) is not a unique parent, combined with #12313 making 
> the caching of homsets depend on identity (not equality) of domain resp. 
> codomain. 
>
> While trying to use UniqueRepresentation on Partitions_n and related 
> classes, I found the following: 
>   sage: class C(UniqueRepresentation, CombinatorialClass): pass 
>   ....: 
>   sage: C.__cmp__.__module__ 
>   'sage.combinat.combinat' 
>   sage: C.__eq__.__module__ 
>   'sage.structure.unique_representation' 
>   sage: C.__hash__.__module__ 
>   'sage.structure.unique_representation' 
>
> Isn't that a total mess? Is there a reason why UniqueRepresentation 
> provides __eq__ and __hash__, but not __cmp__? 
>

I thought __cmp__() is only called if __eq__() is not implemented? I almost 
feel like we should try to push comparisons by "is" (identity) rather than 
"==" (equality) for unique parents.

Side notes, CombinatorialClass is (going to be) deprecated and I believe 
python 3 is deprecating __cmp__() as well.

Also please forgive the naive question, but is there any reason for a 
Parent to not be a UniqueRepresentation?

Thanks,
Travis

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To post to this group, send email to sage-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-devel+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.


Reply via email to