This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: [Enum] move member creation to __set_name__ in order to support __init_subclass__
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.10
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: ethan.furman Nosy List: barry, eli.bendersky, ethan.furman, hroncok
Priority: high Keywords: patch

Created on 2021-01-12 01:27 by ethan.furman, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 24196 merged ethan.furman, 2021-01-12 04:38
Messages (3)
msg384875 - (view) Author: Ethan Furman (ethan.furman) * (Python committer) Date: 2021-01-12 01:27
In discussions about moving the calls to `__set_name__` and `__init_subclass__`, Nick Coughlan made an observation:

Nick Coghlan:
> Both EnumMeta and ABCMeta should probably be relying on `__set_name__`
> for their per-member set up work these days, rather than deferring that
> work until after `__new__` returns.

By having `__set_name__` create the final members, they will be in place for the call to `__init_subclass__`.
msg385006 - (view) Author: Ethan Furman (ethan.furman) * (Python committer) Date: 2021-01-13 07:48
New changeset c314e60388282d9829762fb6c30b12e2807caa19 by Ethan Furman in branch 'master':
bpo-42901: [Enum] move member creation to `__set_name__` (GH-24196)
msg386629 - (view) Author: Miro Hrončok (hroncok) * Date: 2021-02-08 12:41
I found a possible regression:
Date User Action Args
2022-04-11 14:59:40adminsetgithub: 87067
2021-02-08 12:41:34hroncoksetnosy: + hroncok
messages: + msg386629
2021-01-25 23:13:30ethan.furmansetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2021-01-13 07:48:08ethan.furmansetmessages: + msg385006
2021-01-12 04:38:09ethan.furmansetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request23022
2021-01-12 01:29:46ethan.furmanlinkissue42775 superseder
2021-01-12 01:27:28ethan.furmancreate