summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2017-01-29 10:10:30 +0000
committerMartin Panter <vadmium+py@gmail.com>2017-01-29 10:10:30 +0000
commit0fb1e3c9fc84c62a91f1e5889dc8e0855cefa4ae (patch)
tree9efac218afdd40d6f7cf0dbde62ae628a293d70b
parent1485933297d5762dda4e9b7297412e7dd02a8315 (diff)
parent23282e54fdd766945930006ab606641a2db37a4c (diff)
downloadcpython-0fb1e3c9fc84c62a91f1e5889dc8e0855cefa4ae.tar.gz
Issues #12067: Merge hash recommendation from 3.6
-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.