def evaluate_LessOrEqual(context, query): return [binary_comparison(context, query.left, query.right, lambda x, y: x <= y)]
def evaluate_Inequality(context, query): return [Boolean(not binary_comparison(context, query.left, query.right, lambda x, y: x == y).get_value())]
def evaluate_GreaterThan(context, query): # Greater-than operator: same thing as equality, but checks to see if the # left-hand values are greater than the right-hand values instead of # equal. TODO: consider automatic conversion of strings to numbers # during comparisons if one side is already a number return [binary_comparison(context, query.left, query.right, lambda x, y: x > y)]
def evaluate_Equality(context, query): # Equality operator: returns true if any of the values in its left-hand # collection are equal to any of the values in its right-hand collection return [binary_comparison(context, query.left, query.right, lambda x, y: x == y)]