classification
Title: dataclasses: use function dispatch instead of multiple tests for adding __hash__
Type: Stage: resolved
Components: Library (Lib) Versions: Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: eric.smith Nosy List: eric.smith, miss-islington, rhettinger
Priority: normal Keywords: patch

Created on 2018-03-24 21:11 by eric.smith, last changed 2018-03-25 02:32 by eric.smith. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 6222 merged eric.smith, 2018-03-24 23:34
PR 6224 merged miss-islington, 2018-03-25 02:11
Messages (4)
msg314385 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2018-03-24 21:11
There's already a table lookup for what action to take when adding __hash__. Change it to a function dispatch table, instead of using strings and testing them.
msg314389 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2018-03-24 23:01
+1
msg314390 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2018-03-25 02:10
New changeset 01d618c5606a239b03ad1269541eddb6e724775d by Eric V. Smith in branch 'master':
bpo-33134: dataclasses: use function dispatch table for hash, instead of a string lookup which then is tested with if tests. (GH-6222)
https://github.com/python/cpython/commit/01d618c5606a239b03ad1269541eddb6e724775d
msg314391 - (view) Author: miss-islington (miss-islington) Date: 2018-03-25 02:31
New changeset 9989efbb653e8cbd08e51b4d79d094605c8b23b8 by Miss Islington (bot) in branch '3.7':
bpo-33134: dataclasses: use function dispatch table for hash, instead of a string lookup which then is tested with if tests. (GH-6222)
https://github.com/python/cpython/commit/9989efbb653e8cbd08e51b4d79d094605c8b23b8
History
Date User Action Args
2018-03-25 02:32:58eric.smithsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2018-03-25 02:31:31miss-islingtonsetnosy: + miss-islington
messages: + msg314391
2018-03-25 02:11:32miss-islingtonsetpull_requests: + pull_request5965
2018-03-25 02:10:17eric.smithsetmessages: + msg314390
2018-03-24 23:34:33eric.smithsetkeywords: + patch
stage: patch review
pull_requests: + pull_request5963
2018-03-24 23:01:23rhettingersetnosy: + rhettinger
messages: + msg314389
2018-03-24 21:11:21eric.smithcreate