changeset: 106331:9702c5f08df1 branch: 3.6 parent: 106327:b33c3f26eefa parent: 106329:8c9a86aa222e user: Martin Panter date: Sun Jan 29 10:07:26 2017 +0000 files: Doc/reference/expressions.rst description: Issues #12067: Merge hash recommendation from 3.5 diff -r b33c3f26eefa -r 9702c5f08df1 Doc/reference/expressions.rst --- a/Doc/reference/expressions.rst Sat Jan 28 20:16:40 2017 -0800 +++ b/Doc/reference/expressions.rst Sun Jan 29 10:07:26 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.