#NEWLINE# def _check_literal( expr , operator , other , bindparam_type = None ) : #NEWLINE# #INDENT# if isinstance ( other , ( ColumnElement , TextClause ) ) : #NEWLINE# #INDENT# if ( isinstance ( other , BindParameter ) and other . type . _isnull ) : #NEWLINE# #INDENT# other = other . _clone ( ) #NEWLINE# other . type = expr . type #NEWLINE# #UNINDENT# return other #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if hasattr ( other , '__clause_element__' ) : #NEWLINE# #INDENT# other = other . __clause_element__ ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( other , type_api . TypeEngine . Comparator ) : #NEWLINE# #INDENT# other = other . expr #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if isinstance ( other , ( SelectBase , Alias ) ) : #NEWLINE# #INDENT# return other . as_scalar ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( not isinstance ( other , Visitable ) ) : #NEWLINE# #INDENT# return expr . _bind_param ( operator , other , type_ = bindparam_type ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return other