def bad_value(var_name, type_name, value, line, column): return { 'message': DefaultValuesOfCorrectType.bad_value_for_default_arg_message( var_name, type_name, value), 'locations': [SourceLocation(line, column)] }
def bad_value(var_name, type_name, value, line, column, errors=None): if not errors: errors = ['Expected type "{}", found {}.'.format(type_name, value)] return { 'message': DefaultValuesOfCorrectType.bad_value_for_default_arg_message( var_name, type_name, value, errors), 'locations': [SourceLocation(line, column)] }
def bad_value(var_name, type_name, value, line, column, errors=None): if not errors: errors = [ 'Expected type "{}", found {}.'.format(type_name, value) ] return { 'message': DefaultValuesOfCorrectType.bad_value_for_default_arg_message(var_name, type_name, value, errors), 'locations': [SourceLocation(line, column)] }