# HG changeset patch # Parent cebc9c7ad195e4c93c77284d9ebfc19744faf5b5 Issue #12067: Recommend that hash and equality be consistent diff -r cebc9c7ad195 -r b80df2ac978b Doc/reference/expressions.rst --- a/Doc/reference/expressions.rst Mon Jan 23 14:02:35 2017 +0200 +++ b/Doc/reference/expressions.rst Mon Jan 23 21:49:06 2017 +0000 @@ -1415,6 +1415,10 @@ sequences, but not to sets or mappings). See also the :func:`~functools.total_ordering` decorator. +* The :func:`hash` result should be consistent with equality. + Objects that are equal should either have the same hash value, + or be marked as unhashable. + Python does not enforce these consistency rules. In fact, the not-a-number values are an example for not following these rules.