#NEWLINE# def set_value_explicit( self , value = None , data_type = TYPE_STRING ) : #NEWLINE# #INDENT# 'Coerce values according to their explicit type' #NEWLINE# type_coercion_map = { #NEWLINE# #INDENT# self . TYPE_INLINE : self . check_string , #NEWLINE# self . TYPE_STRING : self . check_string , #NEWLINE# self . TYPE_FORMULA : unicode , #NEWLINE# self . TYPE_NUMERIC : msg . check_numeric , #NEWLINE# self . TYPE_BOOL : bool , #NEWLINE# #UNINDENT# } #NEWLINE# try : #NEWLINE# #INDENT# self . _value = type_coercion_map [ data_type ] ( value ) #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# if ( data_type not in self . VALID_TYPES ) : #NEWLINE# #INDENT# msg = ( 'Invalid data type: %s' % data_type ) #NEWLINE# raise DataTypeException ( msg ) #NEWLINE# #UNINDENT# #UNINDENT# self . _data_type = data_type