Hi Florent and Simon, many thanks! That makes sense, I really hadn't considered comparing a conjugacy class with an object of a different type. Testsuite and all test pass on my machine now, so the ticket is ready for review!
The computation of underlying sets of conjugacy classes for matrix groups is terribly slow for now due to the .sage() method failing for gap matrices. I could come around this issue by defining another class just for matrix groups, but I don't think is worth it. A quick fix would be replacing the set method in ConjugacyClassGAP to take into account whether the group is a permutation group or a matrix group, but such a test would need to be rewritten if/when matrix/permutation groups get included in the category framework. In the long run I think the best method is to fix the .sage() method for gap objects so that it works on gap matrices, but this is for another ticket. Cheers, Javier On Dec 7, 12:46 pm, Florent Hivert <florent.hiv...@lri.fr> wrote: > 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