#NEWLINE# def _validate_compareable( self , other ) : #NEWLINE# #INDENT# self_type = type ( self . val ) #NEWLINE# other_type = type ( other ) #NEWLINE# if ( self_type in self . NON_COMPAREABLE_TYPES ) : #NEWLINE# #INDENT# raise TypeError ( ( 'ordering is not defined for type <%s>' % self_type . __name__ ) ) #NEWLINE# #UNINDENT# if ( self_type in self . COMPAREABLE_TYPES ) : #NEWLINE# #INDENT# if ( other_type is not self_type ) : #NEWLINE# #INDENT# raise TypeError ( ( 'given arg must be <%s>, but was <%s>' % ( self_type . __name__ , other_type . __name__ ) ) ) #NEWLINE# #UNINDENT# return #NEWLINE# #UNINDENT# if isinstance ( self . val , numbers . Number ) : #NEWLINE# #INDENT# if ( not isinstance ( other , numbers . Number ) ) : #NEWLINE# #INDENT# raise TypeError ( ( 'given arg must be a number, but was <%s>' % other_type . __name__ ) ) #NEWLINE# #UNINDENT# return #NEWLINE# #UNINDENT# raise TypeError ( ( 'ordering is not defined for type <%s>' % self_type . __name__ ) )