On Monday, December 5, 2016 at 12:35:47 AM UTC-8, Marc Mezzarobba wrote:
>
> Frédéric Chapoton wrote: 
> > There is currently an effort being made (by me and a few referees) to 
> > get rid of cmp() in all pyx files. 
>
> Is there already a replacement for cmp() in Sage (i.e., something that 
> allows one to sort arbitrary objects--say, for printing them--and calls 
> _cmp_() in the case of Elements)? If not, is there a plan to add one? 
>

Yes, there is one in python in general. With

sort(<list>, key=str)

you'll be able to sort lists of all kinds of stuff. You can write your own 
key function if you need more sophisticated ordering. We could of course 
host some key functions as part of sage, but when this came up on 
https://trac.sagemath.org/ticket/20028 it didn't seem there was sufficient 
need for it.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to