Hi Simon,

> On 7 Dez., 10:16, Simon King <simon.k...@uni-jena.de> wrote:
> > But in both cases, it is also assumed that you are using coercion.
> > Hence, when the test "self==None" raises an error or returns a wrong
> > result then it could also be that there is a wrong coercion.
> 
> Ouch, sorry, I thought that your conjugacy classes are the *elements*
> of some parent. But after a brief look at your code, I see that a
> conjugacy class *is* a parent.
> 
> So, forget what I said in my previous post: That was about elements.
> 
> For parents, you simply implement a __cmp__ method (or perhaps
> __richcmp__), but you must not make any assumption on the type of the
> second argument. It is generally expected in Python that a comparison
> will *never* raise an exception, and you need to write your __cmp__
> accordingly.

Indeed ! This is exactly the purpose of having TestSuite checking comparison
with None. You should get False and not an exception. Thanks for the
clarification.

Maybe the error message for TestSuite should be made clearer (catching the
exception and writing an error message that an exception was thrown where
false is expected.

Cheers,

Florent

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to