diff options
author | Eric V. Smith <ericvsmith@users.noreply.github.com> | 2018-03-25 02:10:14 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-25 02:10:14 (GMT) |
commit | 01d618c5606a239b03ad1269541eddb6e724775d (patch) | |
tree | 2e1d50fb4f5c704564de39e72aaf99f716050d02 /Misc | |
parent | f96ddade0094d162cb6c2fd7255c5e8a90b5c37d (diff) | |
download | cpython-01d618c5606a239b03ad1269541eddb6e724775d.zip cpython-01d618c5606a239b03ad1269541eddb6e724775d.tar.gz cpython-01d618c5606a239b03ad1269541eddb6e724775d.tar.bz2 |
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.
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS.d/next/Library/2018-03-24-19-34-26.bpo-33134.hbVeIX.rst | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Library/2018-03-24-19-34-26.bpo-33134.hbVeIX.rst b/Misc/NEWS.d/next/Library/2018-03-24-19-34-26.bpo-33134.hbVeIX.rst new file mode 100644 index 0000000..3f4ce84 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-03-24-19-34-26.bpo-33134.hbVeIX.rst @@ -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. |