Actually, it seems that I have already found an instance of the problem you 
describe, except that I do not understand it.

In sage/algebras/jordan_algebra.py we have two "def __ne__", one in 
JordanAlgebraSymmetricBilinear and one in SpecialJordanAlgebra.

If I remove them (moving the tests to those of __eq__), the following fails:

                sage: m = matrix([[0,1],[1,1]])
                sage: J.<a,b,c> = JordanAlgebra(m)
                sage: x = 4*a - b + 3*c
                sage: x != J((4, (-1, 3)))
                False

I have no idea why, the element class is defined directly in the parent 
JordanAlgebraSymmetricBilinear, and inherits only from AlgebraElement.

Apparently, the problem also arises, if _richcmp_ is implemented in a 
superclass.  I think I knew that once...

Martin

On Saturday, 2 September 2023 at 13:15:04 UTC+2 Martin R wrote:

> On Saturday, 2 September 2023 at 11:39:12 UTC+2 Oscar Benjamin wrote:
>
> On Sat, 2 Sept 2023 at 08:44, 'Martin R' via sage-devel 
> <sage-...@googlegroups.com> wrote: 
>
> ... 
>
>  It is easy for this sort of thing to be overlooked in test code and in 
> fact 
> messing with __eq__/__ne__ (more so __eq__) can invalidate much of the 
> test suite so I would tread carefully. 
>
>
> Could you provide an example?  I would think that in such a case a doctest 
> should catch the problem - what other purpose would a doctest have?
>
> Thank you for your input!
>

-- 
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 sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/6c0cad2a-864c-4635-b4c2-20ec807527b0n%40googlegroups.com.

Reply via email to