Install & Compatibility
Where this runs
tested against v1.1.10 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 17.8MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 1.6s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Enum
✓ from enum import Enum
✗ from enum34 import Enum
IntEnum
✓ from enum import IntEnum
✗ from enum34 import IntEnum
auto
✓ from enum import auto
✗ from enum34 import auto
Defines a basic `Enum` using `auto()` for automatic value assignment and demonstrates accessing members by name, value, and iteration.
from enum34 import Enum, auto
class Color(Enum):
RED = auto()
GREEN = auto()
BLUE = auto()
def __str__(self):
return self.name.lower()
print(f"First color: {Color.RED}")
print(f"Value of GREEN: {Color.GREEN.value}")
print(f"Access by value (1): {Color(1)}")
print(f"Iterating through colors:")
for color in Color:
print(f"- {color.name}: {color.value}")
Debug
Known issues
breaking`enum34` should NOT be used on Python 3.4 or newer. Python 3.4 introduced the `enum` module into the standard library. Using `enum34` on these versions can lead to conflicts, unexpected behavior, or unnecessary overhead. Always use the built-in `enum` module for Python 3.4+.fixRemove `enum34` from your dependencies and switch to `from enum import Enum` (or `IntEnum`, `auto`, etc.) for Python 3.4 and later.
affects: Python >= 3.4
gotchaWhile `enum34` primarily backports `Enum` from Python 3.4, it also includes features like `auto()`, `Flag`, and `StrEnum` which were introduced in later Python versions (3.6 and 3.11 respectively). Be aware that the behavior of these backported features might have subtle differences or limitations compared to their native implementations in newer Python versions.fixThoroughly test your enum implementations, especially when using advanced features like `auto()` or `Flag`, if targeting a wide range of Python versions or migrating to/from native `enum`.
affects: All versions when comparing to native `enum` in Python >= 3.6/3.11
deprecatedFor all new Python projects or projects targeting Python 3.4 or newer, `enum34` is obsolete. Its sole purpose is to provide `enum` functionality to legacy Python 2 and early Python 3 environments (up to 3.3).fixIf starting a new project or upgrading an existing one to Python 3.4+, do not install `enum34`. Rely solely on the standard library's `enum` module.
affects: All versions (in context of new projects)
Upgrade
Version history
1.1.10latest on PyPI · released Mar 10, 2020
Audit
Dependencies
No dependency data recorded yet.