diff --git a/src/sage/combinat/decorated_permutation.py b/src/sage/combinat/decorated_permutation.py index 2632364aff2..03d3e2fb495 100644 --- a/src/sage/combinat/decorated_permutation.py +++ b/src/sage/combinat/decorated_permutation.py @@ -86,6 +86,17 @@ def check(self): if self not in self.parent(): raise ValueError("{} is not a decorated permutation".format(self)) + def __hash__(self): + r""" + Return a hash of ``self``. + + TESTS:: + + sage: len(set(hash(pi) for pi in DecoratedPermutations(3))) + 16 + """ + return hash(tuple(self)) + def __eq__(self, other): """ Check whether ``self`` is equal to ``other``.