1. Tim Delaney
  2. Enum

Overview

HTTPS SSH

New Enum implementation for Python 3.3, using a metaclass to allow enums to be created like:

class Color(Enum):
    RED, GREEN, BLUE
    ORANGE = "orange"
    CYAN = 10
    MAGENTA
    YELLOW
    BLACK

Note that this implementation currently only works with Python 3.3. It was inspired by code posted by Michael Foord on python-ideas.