enum.Enumの実装
#enum.Enum
class Enum(metaclass=EnumType):
https://github.com/python/cpython/blob/v3.11.4/Lib/enum.py#L1051
docstringのExample enumerationわかりやすい
Enumの__new__はメタクラスの__call__から呼ばれる
https://github.com/python/cpython/blob/v3.11.4/Lib/enum.py#L1091
this method is called by the metaclass' __call__ (i.e. Color(3) ), and by pickle
Enumのmetaclassに指定しているEnumType
ドキュメント enum.EnumType
enum.EnumTypeの実装
EnumTypeを指すEnumMetaという変数がある
EnumMeta = EnumType
ref: https://github.com/python/cpython/blob/v3.11.4/Lib/enum.py#L1048