diff --git a/Doc/library/enum.rst b/Doc/library/enum.rst index 827bab0..73dc350 100644 --- a/Doc/library/enum.rst +++ b/Doc/library/enum.rst @@ -378,6 +378,23 @@ It is possible to modify how Enum members are pickled/unpickled by defining :meth:`__reduce_ex__` in the enumeration class. +Omitting values +--------------- + +In many use-cases one doesn't care what the actual value of an enumeration +is. To define this type of simple enumeration, use :class:`object` +to generate unique values. This signifies to the user that these values +are not important. With this construction, one can add, remove, and reorder +members without having to renumber the remaining members:: + + >>> from enum import Enum + >>> class Color(Enum): + ... red = object() + ... green = object() + ... blue = object() + ... + + Functional API --------------