Enum Compat

0.0.3 · deprecated · verified Thu Apr 09

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.

Warnings

Install

Imports

Quickstart

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`.

from enum import Enum

class Color(Enum):
    RED = 1
    GREEN = 2
    BLUE = 3

print(Color.RED)
print(Color.RED.value)
print(Color.GREEN.name)

view raw JSON →