Registry / serialization / enum34

enum34

JSON →
library1.1.10pypypi✓ verified 33d ago

`enum34` backports the `enum.Enum` class from Python 3.4 to older Python versions (2.4-3.3), enabling the use of enumerated types across diverse legacy environments. It also includes selected features from newer Python `enum` modules, such as `auto()` and `Flag` from Python 3.6. The library is currently at version 1.1.10, and due to its nature as a backport, active development has ceased, though it remains functional and stable for its intended purpose.

serialization
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
musl
glibc
py 3.10
4/6 runs
4/6 runs
py 3.11
4/6 runs
4/6 runs
py 3.12
4/6 runs
4/6 runs
py 3.13
4/6 runs
4/6 runs
py 3.9
4/6 runs
4/6 runs
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

from enum import Enum
from enum import IntEnum
from enum 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 footguns
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+.
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.
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).
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
14 hits · last 30 days
gptbot
4
ahrefsbot
4
bytedance
3
claudebot
1
Resources