Hello everybody, I have been playing with groups recently, and fought very hard with my code before I noticed the usual bug:
sage: a == b True sage: hash(a) == hash(b) False Which has (among others) the following consequence: sage: G = groups.presentation.Cyclic(4) sage: G.cayley_graph().vertices() [1, a, a^2, a^-2, a^3, a^-1] To me, the problem comes from the "default" implementation of __hash__ that can be found in sage.structure.element: def __hash__(self): return hash(str(self)) Of course, with such a definition it is very likely that "__hash__" and "__eq__" will never agree. As I expect that removing this dangerous default implementation may break a *lot* of things, I created a ticket (needs_review) that replaces it with "return 0". http://trac.sagemath.org/ticket/19016 Nathann -- 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.