Steve D'Aprano wrote:
On Thu, 10 Aug 2017 07:00 pm, Peter Otten wrote:/* bottom 3 or 4 bits are likely to be 0; rotate y by 4 to avoid excessive hash collisions for dicts and sets */which I think agrees with my comment: using the id() itself would put too many objects in the same bucket (i.e. too many collisions).
I suspect this is more of a minor performance tweak than a vital issue. Otherwise it would mean that dict's algorithm for assigning items to buckets based on the hash isn't all that great. -- Greg -- https://mail.python.org/mailman/listinfo/python-list
