On Mon, Dec 05, 2016 at 05:46:32PM +0100, Marc Mezzarobba wrote:
> Nils Bruin wrote:
> > 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.
> 
> Well, sort(key=str) and sort(key=id) certainly help in many cases, but
> they clearly don't suffice in general. Neither is able to use an order
> defined by the common class when it exists, and key=str may be very
> costly.

Indeed, id() alone can not decide when two objects are equal, so there
should be at least one equality test before using id().

However, mixing the internal order of a common class when it exists
together with id() would loose the transitivity property, so i guess those
two kind of tests should remain separate.

Ciao,
Thierry

 
> -- 
> Marc
> 
> -- 
> 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.

-- 
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