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.

Author hroncok
Recipients ethan.furman, hroncok
Date 2021-02-08.12:41:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1612788072.61.0.998193978145.issue43162@roundup.psfhosted.org>
In-reply-to
Content
Git bisect:

c314e60388282d9829762fb6c30b12e2807caa19 is the first new commit
commit c314e60388282d9829762fb6c30b12e2807caa19
Author: Ethan Furman <ethan@stoneleaf.us>
Date:   Tue Jan 12 23:47:57 2021 -0800

    bpo-42901: [Enum] move member creation to `__set_name__` (GH-24196)
    
    `type.__new__` calls `__set_name__` and `__init_subclass__`, which means
    that any work metaclasses do after calling `super().__new__()` will not
    be available to those two methods.  In particular, `Enum` classes that
    want to make use of `__init_subclass__` will not see any members.
    
    Almost all customization is therefore moved to before the
    `type.__new__()` call, including changing all members to a proto member
    descriptor with a `__set_name__` that will do the final conversion of a
    member to be an instance of the `Enum` class.

 Lib/enum.py                                        | 297 +++++++++++++--------
 Lib/inspect.py                                     |   2 +-
 Lib/test/test_enum.py                              |  15 +-
 .../2021-01-11-17-36-59.bpo-42901.gFd-ta.rst       |   3 +
 4 files changed, 207 insertions(+), 110 deletions(-)
 create mode 100644 bpo-42901.gFd-ta.rst">Misc/NEWS.d/next/Library/2021-01-11-17-36-59.bpo-42901.gFd-ta.rst
History
Date User Action Args
2021-02-08 12:41:12hroncoksetrecipients: + hroncok, ethan.furman
2021-02-08 12:41:12hroncoksetmessageid: <1612788072.61.0.998193978145.issue43162@roundup.psfhosted.org>
2021-02-08 12:41:12hroncoklinkissue43162 messages
2021-02-08 12:41:12hroncokcreate