#NEWLINE# def type_check( self , instance ) : #NEWLINE# #INDENT# error_msg = '' #NEWLINE# for t in e . union_types : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# check_constraint ( t , instance ) #NEWLINE# return #NEWLINE# #UNINDENT# except TypeError as e : #NEWLINE# #INDENT# error_msg = str ( e ) #NEWLINE# continue #NEWLINE# #UNINDENT# #UNINDENT# raise CompositeTypeHintError ( ( '%s type-constraint violated. Expected an instance of one of: %s, received %s instead.%s' % ( repr ( self ) , tuple ( sorted ( ( _unified_repr ( t ) for t in self . union_types ) ) ) , instance . __class__ . __name__ , error_msg ) ) )