aenum is a Python library providing advanced enumerations that are compatible with Python's standard library Enum, along with metaclass-based NamedTuple and NamedConstant implementations. It offers extended features over the built-in `enum` module, such as support for unique values, multiple values, auto-numbering, and control over aliasing. The current version is 3.1.17 and it maintains an active release cadence.
pip install aenumVerified import paths — ran on the pinned version, not inferred.
Demonstrates defining a basic Enum with auto-numbering and a simple NamedTuple.
Migrate away from `AutoNumber` and `AutoValue`. Consider using `aenum.auto()` or manual value assignment.
Ensure `__order__` is correctly defined for Enums in Python 2 if explicit ordering is required, or rely on natural definition order in Python 3. Consider modernizing to Python 3 exclusively where possible.
Explicitly check `member.value` for its numeric truthiness, or override `__bool__` if the Enum member itself should reflect the truthiness of its value.
Carefully test Enums that use mixed-in types when upgrading to Python 3.11 or later. Consult the `enum` module's documentation for Python 3.11+ regarding `__new__` and `__init__` behavior with mixins if encountering issues.
Ensure `NamedTuple` is imported from the `typing` module (e.g., `from typing import NamedTuple`) before use.
Add `from typing import NamedTuple` at the top of the script or module where `NamedTuple` is being used.
Install the 'aenum' module using pip: 'pip install aenum'.
Use the 'Enum' constructor with keyword arguments: 'Enum('EnumName', {'member1': value1, 'member2': value2})'.Use a custom method to search for the Enum member by iterating over the Enum members and checking if the value is in the member's value list.
Upgrade `aenum` to the latest version to resolve packaging issues or compatibility fixes: `pip install --upgrade aenum`
Upgrade `aenum` to the latest stable version, as this specific issue was often resolved in subsequent releases: `pip install --upgrade aenum`
No dependency data recorded yet.