Solutionunvalidated
This is intended to provide protection against a denial-of-service caused by carefully chosen inputs — `__hash__()` values of str and bytes objects are “salted” with an unpredictable random value. Tension: carefully chosen inputs that exploit the worst case performance of a dict insertion, `O(n2)` complexity. Outcome: security benefits of the change won out over the performance impact for strings and `bytes` objects.
3e6e88e1-5f93-4612-b052-0b2cdcbc8239
This is intended to provide protection against a denial-of-service caused by carefully chosen inputs — __hash__() values of str and bytes objects are “salted” with an unpredictable random value. Tension: carefully chosen inputs that exploit the worst case performance of a dict insertion, O(n2) complexity. Outcome: security benefits of the change won out over the performance impact for strings and bytes objects.