[Python-ideas] incremental hashing in __hash__

jab at math.brown.edu jab at math.brown.edu
Wed Dec 28 12:44:55 EST 2016


On Wed, Dec 28, 2016 at 12:10 PM, Ethan Furman <ethan at stoneleaf.us> wrote:

> In other words, objects that do not compare equal can also have the same
> hash value (although too much of that will reduce the efficiency of
> Python's containers).
>

Yes, I realize that unequal objects can return the same hash value with
only performance, and not correctness, suffering. It's the performance I'm
concerned about. That's what I meant by "...to keep from unnecessarily
causing hash collisions..." in my original message, but sorry this wasn't
clearer. We should be able to do this in a way that doesn't increase hash
collisions unnecessarily.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20161228/6e8812c1/attachment.html>


More information about the Python-ideas mailing list