summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2017-01-29 10:07:26 +0000
committerMartin Panter <vadmium+py@gmail.com>2017-01-29 10:07:26 +0000
commit23282e54fdd766945930006ab606641a2db37a4c (patch)
tree07b9dad7d41a7c0452a7a276dd382503050163b6
parent4d8d8f83307efee9a4f79d354b4db99455d1af20 (diff)
parentc360ad44ef4815cb1ebceaf392fcac56426b53aa (diff)
downloadcpython-23282e54fdd766945930006ab606641a2db37a4c.tar.gz
Issues #12067: Merge hash recommendation from 3.5
-rw-r--r--Doc/reference/expressions.rst4
1 files changed, 4 insertions, 0 deletions
diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst
index b37df92d59..3a4b80557c 100644
--- a/Doc/reference/expressions.rst
+++ b/Doc/reference/expressions.rst
@@ -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.