[Python-checkins] cpython (merge 3.6 -> default): Issues #12067: Merge hash recommendation from 3.6

martin.panter python-checkins at python.org
Sun Jan 29 05:34:28 EST 2017


https://hg.python.org/cpython/rev/9dbb7bbc1449
changeset:   106333:9dbb7bbc1449
parent:      106328:9e9f292c65ec
parent:      106331:9702c5f08df1
user:        Martin Panter <vadmium+py at gmail.com>
date:        Sun Jan 29 10:10:30 2017 +0000
summary:
  Issues #12067: Merge hash recommendation from 3.6

files:
  Doc/reference/expressions.rst |  4 ++++
  1 files changed, 4 insertions(+), 0 deletions(-)


diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst
--- a/Doc/reference/expressions.rst
+++ b/Doc/reference/expressions.rst
@@ -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.
 

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list