bpo-42567: [Enum] call __init_subclass__ after members are added (GH-23714)

When creating an Enum, type.__new__ calls __init_subclass__, but at that point the members have not been added.

This patch suppresses the initial call, then manually calls the ancestor __init_subclass__ before returning the new Enum class.
This commit is contained in:
Ethan Furman 2020-12-09 16:41:22 -08:00 committed by GitHub
parent 2a35137328
commit 6bd94de168
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 104 additions and 2 deletions

View file

@ -0,0 +1 @@
`Enum`: call `__init_subclass__` after members have been added