def __init__ ( self, *args, **metadata ):
        values = metadata.pop( 'values', None )
        if isinstance( values, basestring ):
            n = len( args )
            if n == 0:
                default_value = None
            elif n == 1:
                default_value = args[0]
            else:
                raise TraitError( "Incorrect number of arguments specified "
                                  "when using the 'values' keyword" )
            self.name   = values
            self.values = compile( 'object.' + values, '<string>', 'eval' )
            self.get, self.set, self.validate = self._get, self._set, None
        else:
            default_value = args[0]
            if (len( args ) == 1) and isinstance( default_value, SequenceTypes):
                args          = default_value
                default_value = args[0]
            elif (len( args ) == 2) and isinstance( args[1], SequenceTypes ):
                args = args[1]

            self.name   = ''
            self.values = tuple( args )
            self.init_fast_validator( 5, self.values )

        super( BaseEnum, self ).__init__( default_value, **metadata )
Returns an Enum trait.
dataset/ETHPy150Open enthought/traits/traits/trait_types.py/BaseEnum.__init__