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

Created on 2021-01-12 01:27 by ethan.furman, last changed 2021-01-13 07:48 by ethan.furman.

Pull Requests
URL Status Linked Edit
PR 24196 merged ethan.furman, 2021-01-12 04:38
Messages (2)
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)
https://github.com/python/cpython/commit/c314e60388282d9829762fb6c30b12e2807caa19
History
Date User Action Args
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