[sage-devel] Re: Re: Cross-type comparisons

2016-12-05 Thread Marc Mezzarobba
Thierry wrote: > 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. I'm not sure I follow you: doesn't what cmp() does (if I understand right: use the internal

[sage-devel] Re: Cross-type comparisons

2016-12-05 Thread Marc Mezzarobba
Travis Scrimshaw wrote: >> Sorry, I don't understand your example: I think everyone agrees that >> ZZ == QQ should be False, but many people think that ZZ(1) == QQ(1) >> should be True (though I personally disagree), and my post only was >> about Elements. > > One potential side effect of what you

Re: [sage-devel] Re: Cross-type comparisons

2016-12-05 Thread Thierry
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(, 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 > t

[sage-devel] Re: Cross-type comparisons

2016-12-05 Thread Marc Mezzarobba
Nils Bruin wrote: > Yes, there is one in python in general. With > > sort(, 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 th

[sage-devel] Re: Cross-type comparisons

2016-12-05 Thread Nils Bruin
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 > all

[sage-devel] Re: Cross-type comparisons

2016-12-05 Thread Marc Mezzarobba
Thierry wrote: > Note that there are not only "mathemathical" orderings, but also > "algorithmic" ones. It is useful (and i bet assumed in various Sage > algorithms) to be able to totally order any pair of Python objects, > e.g. when you want to traverse a graph, or even identify edges: > > sage:

Re: [sage-devel] Cross-type comparisons

2016-12-05 Thread Thierry
On Mon, Dec 05, 2016 at 08:04:11AM +0100, Jeroen Demeyer wrote: > On 2016-12-04 19:39, Marc Mezzarobba wrote: > >Hi, > > > >Does Element.__richcmp__() (via CoercionModel_cache_maps.richcmp()) > >really need to fall back on comparing by type/id when no common parent > >is found? > > No. As far as I

[sage-devel] Re: Cross-type comparisons

2016-12-05 Thread Travis Scrimshaw
> > We need to be very careful about defining "not knowing". I (stongly) > > believe when the objects/types are incomparable (say the rings ZZ and > > QQ), then == should return False and != should return True. > > Sorry, I don't understand your example: I think everyone agrees that > ZZ == Q

Re: [sage-devel] Sage runs in Window's 10's new Unix subsystem

2016-12-05 Thread gnkapet
Hi from me. My (more recent) experience is similar but not identical. I install sage from the ppa and I am having problems. Sage loads and seems to be working, but: ┌┐ │ SageMath version 7.3, Release Date: 2016-08-04

Re: [sage-devel] SAGE_ATLAS_LIB vs openblas

2016-12-05 Thread Thierry
On Mon, Dec 05, 2016 at 10:43:03AM +0100, Erik Bray wrote: > On Sat, Dec 3, 2016 at 12:55 PM, Thierry > wrote: > > Hi, > > > > On Sat, Dec 03, 2016 at 10:00:51AM +0100, Jeroen Demeyer wrote: > >> On 2016-12-02 09:21, Thierry wrote: > >> >Would it be > >> >preferable to have this possibility dealt

Re: [sage-devel] SAGE_ATLAS_LIB vs openblas

2016-12-05 Thread Erik Bray
On Sat, Dec 3, 2016 at 12:55 PM, Thierry wrote: > Hi, > > On Sat, Dec 03, 2016 at 10:00:51AM +0100, Jeroen Demeyer wrote: >> On 2016-12-02 09:21, Thierry wrote: >> >Would it be >> >preferable to have this possibility dealt at configure time >> >> Absolutely. Whatever you do, do *NOT* introduce a n

[sage-devel] Re: Cross-type comparisons

2016-12-05 Thread Marc Mezzarobba
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 o