Hi Jean-Pierre, > I'm not sure I understand correctly; do you mean that the problem is > caused by fields comparing equal even if the implementations are > different? I think we should in any > > Not sure. > I seem to be able to produce things with different hashes but equal... > sage: GF(13**5, 'a', impl='pari_ffelt') == GF(13**5, 'a', impl='flint_fq') > True
This should probably be False; even though the fields are canonically isomorphic, pretending that they are equal sounds like asking for trouble to me... > Though I have: > sage: GF(13**5, 'a', impl='pari_ffelt') == GF(13**5, 'a', impl='pari_mod') > False > Maybe that's because of the __cmp__ functions I copied/pasted/slightly > modified. > Or maybe I forgot to implement some methods as the new classes are cdefed. > I'll check that. I'm testing a patch that makes FiniteField behave like WithEqualityById (unfortunately, inheriting from it is not possible because Cython does not support multiple inheritance) and removes all hashing and comparison methods from other finite field classes. By the way, there is no point in relying on hashes being different for "different" objects if they still compare equal; there is always some small probability of a hash collision. (I just saw that Simon King wrote something to the same effect.) Peter -- 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 post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.