def types_msg(instance, types):
 reprs = []
 for type in types:
  try:
   reprs.append(repr(type['name']))
  except Exception:
   reprs.append(repr(type))
 return ('%r is not of type %s' % (instance, ', '.join(reprs)))

def types_msg ( instance , types ) : reprs = [ ] for type in types : try : reprs . append ( repr ( type [ 'name' ] ) ) except Exception : reprs . append ( repr ( type ) ) return ( '%r is not of type %s' % ( instance , ', ' . join ( reprs ) ) )
create an error message for a failure to match the given types .