diff options
author | Martin Panter <vadmium+py@gmail.com> | 2017-01-29 10:07:26 +0000 |
---|---|---|
committer | Martin Panter <vadmium+py@gmail.com> | 2017-01-29 10:07:26 +0000 |
commit | 23282e54fdd766945930006ab606641a2db37a4c (patch) | |
tree | 07b9dad7d41a7c0452a7a276dd382503050163b6 | |
parent | 4d8d8f83307efee9a4f79d354b4db99455d1af20 (diff) | |
parent | c360ad44ef4815cb1ebceaf392fcac56426b53aa (diff) | |
download | cpython-23282e54fdd766945930006ab606641a2db37a4c.tar.gz |
Issues #12067: Merge hash recommendation from 3.5
-rw-r--r-- | Doc/reference/expressions.rst | 4 |
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. |