Dear all,

the current implementation of __hash__ for PermutationGroupElement returns 
a hash that not only depends on the given permutation, but also on the 
group the permutation lives in.
Thus the "same" permutation (when compared with __eq__) may have different 
hash values, which is not in line with the Python documentation (
https://docs.python.org/3.5/reference/datamodel.html#object.__hash__) and 
leads to unexpected situations as the following.

sage: G = SymmetricGroup(2) 
sage: H = SymmetricGroup(1)
sage: d = {G.one() : "FooBaa"} 
sage: H.one() in list(d.keys())
True 
sage: H.one() in d
False

Best,
Johannes Schwab

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/66a4796f-19da-42aa-b530-4f7f70402979n%40googlegroups.com.

Reply via email to