A small library for adding total orderings to enums, providing an OrderedEnum base class that supports comparison operators (<, <=, >, >=) based on member definition order. Version 0.0.10, released in 2024, requires Python >=3.9. Maintained with infrequent releases.
pip install ordered-enumVerified import paths — ran on the pinned version, not inferred.
Define an enum with ordered comparisons based on member declaration order.
Ensure comparisons only within the same enum class.
Use the .value attribute for numeric comparisons: Color.RED.value < 1.
For simple ordered enums, use Python's IntEnum with auto() and custom ordering, or use another library.
Use correct import: from ordered_enum import OrderedEnum
Ensure both operands are members of the same OrderedEnum subclass.
No dependency data recorded yet.