]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
doc: Suggest to hash(tuple of attr) rather than XOR
authorVictor Stinner <victor.stinner@gmail.com>
Mon, 19 Dec 2016 12:15:35 +0000 (13:15 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Mon, 19 Dec 2016 12:15:35 +0000 (13:15 +0100)
commitf6447e006587fcb632b80ca7e5888cefc1a26d58
treeaee08bc2d5f095e9c3c9295d13c0f6b87ebe836b
parent805f283aa311043a498fecc29cf7bc13e4311fd6
doc: Suggest to hash(tuple of attr) rather than XOR

Issue #28383: __hash__ documentation recommends naive XOR to combine but this
is suboptimal. Update the doc to suggest to reuse the hash() method using a
tuple, with an example.
Doc/reference/datamodel.rst