Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit af4e5d9

Browse files
committed
Issues #12067: Merge hash recommendation from 3.6
2 parents bea12f4 + 2be9889 commit af4e5d9

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Doc/reference/expressions.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1415,6 +1415,10 @@ some consistency rules, if possible:
14151415
sequences, but not to sets or mappings). See also the
14161416
:func:`~functools.total_ordering` decorator.
14171417

1418+
* The :func:`hash` result should be consistent with equality.
1419+
Objects that are equal should either have the same hash value,
1420+
or be marked as unhashable.
1421+
14181422
Python does not enforce these consistency rules. In fact, the not-a-number
14191423
values are an example for not following these rules.
14201424

0 commit comments

Comments
 (0)