classification
Title: pstats.SortKey enum is broken
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.10, Python 3.9, Python 3.8
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: ethan.furman Nosy List: ethan.furman, miss-islington
Priority: normal Keywords: patch

Created on 2020-09-19 08:49 by ethan.furman, last changed 2020-09-19 19:57 by ethan.furman. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 22316 merged ethan.furman, 2020-09-19 09:02
PR 22325 merged miss-islington, 2020-09-19 18:13
PR 22326 merged miss-islington, 2020-09-19 18:13
Messages (4)
msg377153 - (view) Author: Ethan Furman (ethan.furman) * (Python committer) Date: 2020-09-19 08:49
Currently, __new__ creates each member as an empty string, then adds the _value_ attribute.  Because of this, each member is equal to each other, and all appear the same to any data structure that relies on equality and hash as distinguishers (so, basically, all of them).

The fix is to use the first value as the string to be created.
msg377180 - (view) Author: Ethan Furman (ethan.furman) * (Python committer) Date: 2020-09-19 18:13
New changeset ae0d2a33ec05aece939a959d36fcf1df1e210a08 by Ethan Furman in branch 'master':
bpo-41811: create SortKey members using first given value (GH-22316)
https://github.com/python/cpython/commit/ae0d2a33ec05aece939a959d36fcf1df1e210a08
msg377189 - (view) Author: Ethan Furman (ethan.furman) * (Python committer) Date: 2020-09-19 19:56
New changeset 0e4d526de47eae24b75f3623cd56bb0453fc8c74 by Miss Islington (bot) in branch '3.9':
bpo-41811: create SortKey members using first given value (GH-22316) (GH-22325)
https://github.com/python/cpython/commit/0e4d526de47eae24b75f3623cd56bb0453fc8c74
msg377190 - (view) Author: Ethan Furman (ethan.furman) * (Python committer) Date: 2020-09-19 19:56
New changeset 488e3eb70d24d5ce55ae0d7aed13a3721d3eb8a1 by Miss Islington (bot) in branch '3.8':
bpo-41811: create SortKey members using first given value (GH-22316) (GH-22326)
https://github.com/python/cpython/commit/488e3eb70d24d5ce55ae0d7aed13a3721d3eb8a1
History
Date User Action Args
2020-09-19 19:57:36ethan.furmansetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2020-09-19 19:56:33ethan.furmansetmessages: + msg377190
2020-09-19 19:56:20ethan.furmansetmessages: + msg377189
2020-09-19 18:13:48miss-islingtonsetpull_requests: + pull_request21370
2020-09-19 18:13:40miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request21369
2020-09-19 18:13:23ethan.furmansetmessages: + msg377180
2020-09-19 09:02:05ethan.furmansetkeywords: + patch
stage: patch review
pull_requests: + pull_request21361
2020-09-19 08:49:31ethan.furmancreate