The docs are quite good:
enum — Support for enumerations New in version 3.4.
Source code: Lib/enum.py
An enumeration is a set of symbolic names (members) bound to unique,
constant values. Within an enumeration, the members can be compared by
identity, and the enumeration itself can be iterated over.
[...]
Creating an Enum Enumerations are created using the class syntax,
which makes them easy to read and write. An alternative creation
method is described in Functional API. To define an enumeration,
subclass Enum as follows:
>>>
>>> from enum import Enum
>>> class Color(Enum):
... RED = 1
... GREEN = 2
... BLUE = 3
...
Note Enum member values Member values can be anything: int, str, etc..
If the exact value is unimportant you may use auto instances and an
appropriate value will be chosen for you. Care must be taken if you
mix auto with other values.
Note Nomenclature The class Color is an enumeration (or enum)
The attributes Color.RED, Color.GREEN, etc., are enumeration members
(or enum members) and are functionally constants.
The enum members have names and values (the name of Color.RED is RED,
the value of Color.BLUE is 3, etc.)
Note Even though we use the class syntax to create Enums, Enums are
not normal Python classes. See How are Enums different? for more
details.
Enumeration members have human readable string representations:
>>>
>>> print(Color.RED)
Color.RED