mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
bpo-33134: dataclasses: use function dispatch table for hash, instead of a string lookup which then is tested with if tests. (GH-6222)
* Change _hash_action to be a function table lookup, instead of a list of strings which is then tested with if statements.
This commit is contained in:
parent
f96ddade00
commit
01d618c560
2 changed files with 39 additions and 40 deletions
|
@ -0,0 +1,3 @@
|
|||
When computing dataclass's __hash__, use the lookup table to contain the
|
||||
function which returns the __hash__ value. This is an improvement over
|
||||
looking up a string, and then testing that string to see what to do.
|
Loading…
Add table
Add a link
Reference in a new issue