[Python-checkins] cpython (merge 3.5 -> 3.6): Issues #12067: Merge hash recommendation from 3.5
martin.panter
python-checkins at python.org
Sun Jan 29 05:34:27 EST 2017
https://hg.python.org/cpython/rev/9702c5f08df1
changeset: 106331:9702c5f08df1
branch: 3.6
parent: 106327:b33c3f26eefa
parent: 106329:8c9a86aa222e
user: Martin Panter <vadmium+py at gmail.com>
date: Sun Jan 29 10:07:26 2017 +0000
summary:
Issues #12067: Merge hash recommendation from 3.5
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