@@ -1091,27 +1091,15 @@ def _check_eval_validity(value, comparison):
10911091 # It will raise an appropriate error (like NameError for undefined constants)
10921092 return True
10931093
1094- if operator in [">=" , "<=" , ">" , "<" ]:
1095- if value is None or operand is None or isinstance (value , list ) or isinstance (operand , list ):
1096- return False
1097-
1098- if operator == "in" : # Ruby doesn't have this operator
1099- if isinstance (operand , str ) and not isinstance (value , str ) or not isinstance (operand , list ):
1100- return False
1101-
1102- return True
1103-
1104- operator , operand = extract_operator_and_operand_from_comparison (comparison )
1105-
1106- if operator in [">=" , "<=" , ">" , "<" ]:
1107- if value is None or operand is None or isinstance (value , list ) or isinstance (operand , list ):
1108- return False
1109-
1110- if operator == "in" : # Ruby doesn't have this operator
1111- if isinstance (operand , str ) and not isinstance (value , str ) or not isinstance (operand , list ):
1112- return False
1113-
1114- return True
1094+ if operator in [">=" , "<=" , ">" , "<" ] and (
1095+ value is None or operand is None or isinstance (value , list ) or isinstance (operand , list )
1096+ ):
1097+ return False
1098+
1099+ # Ruby doesn't have the "in" operator
1100+ return not (
1101+ operator == "in" and (isinstance (operand , str ) and not isinstance (value , str ) or not isinstance (operand , list ))
1102+ )
11151103
11161104
11171105# Interesting formatter to a specific number of significant digits:
0 commit comments