Returns ``['__class__', '__doc__', '__module__', 'name', 'value']`` and
any public methods defined on *self.__class__*::
+ >>> from enum import Enum
>>> from datetime import date
>>> class Weekday(Enum):
... MONDAY = 1
A *staticmethod* that is used to determine the next value returned by
:class:`auto`::
- >>> from enum import auto
+ >>> from enum import auto, Enum
>>> class PowersOfThree(Enum):
... @staticmethod
... def _generate_next_value_(name, start, count, last_values):
A *classmethod* for looking up values not found in *cls*. By default it
does nothing, but can be overridden to implement custom search behavior::
- >>> from enum import StrEnum
+ >>> from enum import auto, StrEnum
>>> class Build(StrEnum):
... DEBUG = auto()
... OPTIMIZED = auto()
Returns the string used for *repr()* calls. By default, returns the
*Enum* name, member name, and value, but can be overridden::
+ >>> from enum import auto, Enum
>>> class OtherStyle(Enum):
... ALTERNATE = auto()
... OTHER = auto()
Returns the string used for *str()* calls. By default, returns the
*Enum* name and member name, but can be overridden::
+ >>> from enum import auto, Enum
>>> class OtherStyle(Enum):
... ALTERNATE = auto()
... OTHER = auto()
Returns the string used for *format()* and *f-string* calls. By default,
returns :meth:`__str__` return value, but can be overridden::
+ >>> from enum import auto, Enum
>>> class OtherStyle(Enum):
... ALTERNATE = auto()
... OTHER = auto()