enum.IntEnum()
enum.IntEnum() is a Python function in the Enum Module category. An Enum that is also a subclass of int (members can be used as integers). The syntax is enum.IntEnum. Returns: IntEnum class. A typical example: from enum import IntEnum
class Status(IntEnum):
OK = 200
NOT_FOUND = 404
Status.OK == 200 # True. A close sibling is enum.Enum(), which creates an enumeration class with named constants. A close sibling is enum.auto(), which automatically assigns integer values to enum members (starting from 1). A close sibling is enum.Flag(), which an Enum with bitwise operations for combining flags. More about this category: Enumeration types — Enum, IntEnum, Flag, auto. For a broader walkthrough, read the Enum Module guide. Related Enum Module entries: enum.Enum(), enum.auto(), enum.Flag(). This page is part of the free Python Reference documentation covering 978+ functions, methods, and modules with examples and parameter details.