Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-33134: dataclasses: use function dispatch table for hash, instead of a string lookup which then is tested with if tests. #6222

Merged

Conversation

ericvsmith
Copy link
Member

@ericvsmith ericvsmith commented Mar 24, 2018

We already have a lookup table, just use it for dispatching to functions that compute the __hash__ value.

https://bugs.python.org/issue33134

@ericvsmith ericvsmith merged commit 01d618c into python:master Mar 25, 2018
@miss-islington
Copy link
Contributor

Thanks @ericvsmith for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖

@bedevere-bot
Copy link

GH-6224 is a backport of this pull request to the 3.7 branch.

@ericvsmith ericvsmith deleted the bpo-33134-dataclasses-use-dispatch-table branch March 25, 2018 02:11
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 25, 2018
… of a string lookup which then is tested with if tests. (pythonGH-6222)

* Change _hash_action to be a function table lookup, instead of a list
of strings which is then tested with if statements.
(cherry picked from commit 01d618c)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
miss-islington added a commit that referenced this pull request Mar 25, 2018
… 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.
(cherry picked from commit 01d618c)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants