On this page
enum.EnumType
Prev: enum.EnumMeta | Up: enum | Next: enum.Flag
Rel: enum.auto, enum.Enum, enum.EnumCheck, enum.EnumDict
Ref: docs.python.org — enum.EnumType
Tags: #public #python3 #stdlib #enum
Import
import enum
from enum import EnumType
Signature & Overview
enum.EnumType(cls, bases, classdict, *, boundary=None, _simple=False, **kwds)
Metaclass for Enum
Methods & Attributes
EnumType.mro(self, /)— Return a type's method resolution order.
Usage
from enum import Enum, EnumType
class Color(Enum):
RED = 1
assert type(Color) is EnumType
Gotchas
- Canonical metaclass name in Python 3.11+:
EnumMetaremains as a backwards-compatible alias.
REPL Inspect
from enum import EnumType
help(EnumType)
Linked from
Related notes
- tuts/python3/stdlib_module/enum/EnumMeta Linked here; links to this page; shared tags: #enum, #stdlib
- tuts/python3/stdlib_module/enum/Flag Linked here; links to this page; shared tags: #enum, #stdlib
- tuts/python3/stdlib_module/enum/auto Linked here; shared tags: #enum, #stdlib
- tuts/python3/stdlib_module/enum/Enum Linked here; shared tags: #enum, #stdlib
- tuts/python3/stdlib_module/enum/EnumCheck Linked here; shared tags: #enum, #stdlib
- tuts/python3/stdlib_module/enum/EnumDict Linked here; shared tags: #enum, #stdlib
- tuts/python3/stdlib_module/enum links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/enum/FlagBoundary shared tags: #enum, #stdlib
- tuts/python3/stdlib_module/enum/global_enum shared tags: #enum, #stdlib
- tuts/python3/stdlib_module/enum/global_enum_repr shared tags: #enum, #stdlib