def enum(names):
    "Create a simple enumeration having similarities to C."
    return type('enum', (), dict(map(reversed, enumerate(
        names.replace(',', ' ').split())), __slots__=()))()
Create a simple enumeration having similarities to C.
recipes/Python/577021_Short_Enum_Recipe/recipe-577021.py