[sage-devel] Re: Re: Re: hash for algebraic field

2014-06-11 Thread Marc Mezzarobba
Robert Bradshaw wrote: So you would prefer sage: 4/2 == 2 False sage: 4/2 + 0/1 == 2 + 0/1 True Definitely. sage: R.x == ZZ[] sage: (x-1) * (x+1) - x^2 + 1 == 0 False I certainly agree that being able to use == 0 here is convenient. But having to write, say, eq(pol, 0) instead does

[sage-devel] Re: Re: Re: hash for algebraic field

2014-06-11 Thread Volker Braun
On Wednesday, June 11, 2014 8:40:54 AM UTC+1, Marc Mezzarobba wrote: Not that bad if x != 1 throws an exception. Besides, Java programmers have had a similar problem forever and can apparently live with it... Comparisons in Java are probably one of the #1 traps for the unwary (and

[sage-devel] Re: Re: Re: hash for algebraic field

2014-06-11 Thread mmarco
Since we already have Sequence, and Set, which mimic list and set but performing coercion on all its elements, would it be wise to also have Dict? Or even change Sequence to List and make Sequence inmutable? -- You received this message because you are subscribed to the Google Groups

Re: [sage-devel] Re: Re: Re: hash for algebraic field

2014-06-11 Thread Erik Massop
On Wed, 11 Jun 2014 05:14:40 -0700 (PDT) mmarco mma...@unizar.es wrote: Since we already have Sequence, and Set, which mimic list and set but performing coercion on all its elements, would it be wise to also have Dict? Or even change Sequence to List and make Sequence inmutable? It seems

[sage-devel] Re: Re: Re: hash for algebraic field

2014-06-11 Thread Marc Mezzarobba
Volker Braun wrote: Comparisons in Java are probably one of the #1 traps for the unwary (and inconsistent between primitives and objects). But at least for objects, Java == is just the Python is. And .equals() is Python ==. So there you have your two comparisons already. Really, you are

Re: [sage-devel] Re: Re: Re: hash for algebraic field

2014-06-11 Thread Robert Bradshaw
On Wed, Jun 11, 2014 at 12:42 AM, Marc Mezzarobba m...@mezzarobba.net wrote: Robert Bradshaw wrote: So you would prefer sage: 4/2 == 2 False sage: 4/2 + 0/1 == 2 + 0/1 True Definitely. sage: R.x == ZZ[] sage: (x-1) * (x+1) - x^2 + 1 == 0 False I certainly agree that being able to