Skip to content

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

Merged
ericvsmith merged 3 commits into
python:masterfrom
ericvsmith:bpo-33134-dataclasses-use-dispatch-table
Mar 25, 2018
Merged

bpo-33134: dataclasses: use function dispatch table for hash, instead of a string lookup which then is tested with if tests.#6222
ericvsmith merged 3 commits into
python:masterfrom
ericvsmith:bpo-33134-dataclasses-use-dispatch-table

Conversation

@ericvsmith

@ericvsmith ericvsmith commented Mar 24, 2018

Copy link
Copy Markdown
Member

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
Copy Markdown
Contributor

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

@bedevere-bot

Copy link
Copy Markdown

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