Helloooooooooooooooooooo !! This is because "named groups" override the __eq__ method of > UniqueRepresentation, but do not override the __hash__ method. So, > that's broken. Similar things happen a lot in sage/graphs. >
Looks like the only occurrence of UniqueRepresentation in graphs is in isgci.py. If you want to remove it, please help yourself as it is totally useless. UniqueRepresentation is not just about "caching of an object by means of > the > arguments used to create it"! In addition, it is about objects that > compare > equal if and only if they are identical. Hence, overriding __eq__ simply > makes no sense for sub-classes of UniqueRepresentation. > Yeah, well.. We had some problem with this in ticket #14019. Precisely. > What shall we do about it? > Blow it up and see what happens. To the very least, UniqueRepresentation should not be used as a base > class for named groups. One could still use ClasscallMetaclass and use a > weak_cached_function decorator on __classcall__, in order to cache named > groups. > > But in addition, the hash is broken in the example above. Do you have a > good suggestion for a hash that is compatible with comparison of these > named groups? Similarly for graphs. Graphs are not UniqueRepresentation. I personally love it this way. But you can safely remove it from isgci.py, nobody will mind ! 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.