changeset: 106333:9dbb7bbc1449 parent: 106328:9e9f292c65ec parent: 106331:9702c5f08df1 user: Martin Panter date: Sun Jan 29 10:10:30 2017 +0000 description: Issues #12067: Merge hash recommendation from 3.6 diff -r 9e9f292c65ec -r 9dbb7bbc1449 Doc/reference/expressions.rst --- a/Doc/reference/expressions.rst Sat Jan 28 20:17:07 2017 -0800 +++ b/Doc/reference/expressions.rst Sun Jan 29 10:10:30 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.