'Create an enumeration instance.'

def __init__(self, *keys, **kwargs):

    value_type = kwargs.get('value_type', EnumValue)
    if (not keys):
        raise EnumEmptyError()
    keys = tuple(keys)
    values = ([None] * len(keys))
    for (i, key) in enumerate(keys):
        value = value_type(self, i, key)
        values[i] = value
        try:
            super(Enum, self).__setattr__(key, value)
        except TypeError:
            raise EnumBadKeyError(key)
    self.__dict__['_keys'] = keys
    self.__dict__['_values'] = values
