Issues #12067: Merge hash recommendation from 3.5

This commit is contained in:
Martin Panter 2017-01-29 10:07:26 +00:00
commit 2be9889405
1 changed files with 4 additions and 0 deletions

View File

@ -1415,6 +1415,10 @@ some consistency rules, if possible:
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.