def enumeration(*values, **kwargs):
 if (not (values and all(((isinstance(value, string_types) and value) for value in values)))):
  raise ValueError(('expected a non-empty sequence of strings, got %s' % values))
 if (len(values) != len(set(values))):
  raise ValueError(('enumeration items must be unique, got %s' % values))
 attrs = dict([(value, value) for value in values])
 attrs.update({'_values': list(values), '_default': values[0], '_case_sensitive': kwargs.get('case_sensitive', True)})
 return type('Enumeration', (Enumeration,), attrs)()

def enumeration ( * values , ** kwargs ) : if ( not ( values and all ( ( ( isinstance ( value , string_types ) and value ) for value in values ) ) ) ) : raise ValueError ( ( 'expected a non-empty sequence of strings, got %s' % values ) ) if ( len ( values ) != len ( set ( values ) ) ) : raise ValueError ( ( 'enumeration items must be unique, got %s' % values ) ) attrs = dict ( [ ( value , value ) for value in values ] ) attrs . update ( { '_values' : list ( values ) , '_default' : values [ 0 ] , '_case_sensitive' : kwargs . get ( 'case_sensitive' , True ) } ) return type ( 'Enumeration' , ( Enumeration , ) , attrs ) ( )
create an |enumeration| object from a sequence of values .