#NEWLINE# def number_pair_validator( number_type , length = None , delimiter = ',' , error_message_not_number = None , error_message_list_count = None ) : #NEWLINE# #INDENT# def validator( raw_value ) : #NEWLINE# #INDENT# number_validator = custom_message_validator ( number_type , error_message = error_message_not_number ) #NEWLINE# pairs = list ( map ( ( lambda x : number_validator ( x . strip ( ) ) ) , raw_value . split ( delimiter ) ) ) #NEWLINE# if ( ( length is not None ) and ( len ( pairs ) != length ) ) : #NEWLINE# #INDENT# raise ValueError ( ( error_message_list_count or 'The number of items in the pair is incorrect.' ) ) #NEWLINE# #UNINDENT# return pairs #NEWLINE# #UNINDENT# return validator