{"id":1472,"library":"enum-compat","title":"Enum Compat","description":"A 'virtual' package (version 0.0.3) designed to provide `enum.Enum` compatibility across Python versions. Its sole purpose is to install the `enum34` backport on Python versions older than 3.4. On Python 3.4 and later, it acts as a no-op, as `enum` is part of the standard library. The project's last release was in October 2019, and it has no active development or release cadence.","status":"deprecated","version":"0.0.3","language":"en","source_language":"en","source_url":"https://github.com/jstasiak/enum-compat","tags":["enum","compatibility","python2","python3","backport"],"install":[{"cmd":"pip install enum-compat","lang":"bash","label":"Install enum-compat"}],"dependencies":[{"reason":"Provides the Enum type for Python versions older than 3.4. Installed conditionally.","package":"enum34","optional":false}],"imports":[{"note":"enum-compat itself does not provide symbols for direct import; its purpose is to ensure `from enum import Enum` works correctly across Python versions by conditionally installing enum34.","symbol":"Enum","correct":"from enum import Enum"}],"quickstart":{"code":"from enum import Enum\n\nclass Color(Enum):\n    RED = 1\n    GREEN = 2\n    BLUE = 3\n\nprint(Color.RED)\nprint(Color.RED.value)\nprint(Color.GREEN.name)","lang":"python","description":"This quickstart demonstrates the usage of Python's `enum.Enum` type, which `enum-compat` ensures is available. On Python 3.4+ this comes from the standard library; on older versions, `enum-compat` makes the `enum34` backport available as `enum`."},"warnings":[{"fix":"Remove `enum-compat` from your dependencies. Instead, specify `enum34` conditionally for Python versions less than 3.4 directly in your `setup.py` or `pyproject.toml`.","message":"The `enum-compat` package is explicitly discouraged for direct use by its maintainer. You should directly depend on `enum34` with a version specifier for older Python versions (e.g., `'enum34; python_version < \"3.4\"'`) in your `install_requires` instead of `enum-compat`.","severity":"breaking","affected_versions":"All versions"},{"fix":"Ensure your project's dependency management (e.g., `setup.py`, `pyproject.toml`) only installs `enum34` when `python_version < \"3.4\"`.","message":"On Python 3.4 and newer, `enum` is part of the standard library. Installing `enum-compat` (or `enum34`) on these versions is redundant and serves no functional purpose, potentially leading to confusion about the source of the `enum` module.","severity":"gotcha","affected_versions":"Python 3.4 and newer"},{"fix":"Modern Python projects (Python 3.8+) should directly use the built-in `enum` module. For projects requiring Python 3.4-3.7, `enum` is built-in. Only very old projects requiring Python < 3.4 might have a legitimate, though discouraged, reason to use `enum34` directly.","message":"The `enum-compat` package has not seen updates since 2019 and explicitly recommends against its own use. It targets a compatibility problem for Python versions that are now past their end-of-life (Python 2.x, Python 3.0-3.3).","severity":"deprecated","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}