Commit 2be98894 authored by Martin Panter's avatar Martin Panter

Issues #12067: Merge hash recommendation from 3.5

parents e53bd8e2 8dbb0ca5
...@@ -1415,6 +1415,10 @@ some consistency rules, if possible: ...@@ -1415,6 +1415,10 @@ some consistency rules, if possible:
sequences, but not to sets or mappings). See also the sequences, but not to sets or mappings). See also the
:func:`~functools.total_ordering` decorator. :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 Python does not enforce these consistency rules. In fact, the not-a-number
values are an example for not following these rules. values are an example for not following these rules.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment