Test error cases of comparisons
+from testutils import assert_raises
assert 1 < 2
assert 1 < 2 < 3
@@ -11,3 +12,12 @@ assert not 5 == 5 != 5 == 5
assert not 1 < 2 < 3 > 4
assert not 1 < 2 > 3 < 4
assert not 1 > 2 < 3 < 4
+
+def test_type_error(x, y):
+ assert_raises(TypeError, lambda: x < y)
+ assert_raises(TypeError, lambda: x <= y)
+ assert_raises(TypeError, lambda: x > y)
+ assert_raises(TypeError, lambda: x >= y)
+
+test_type_error([], 0)
+test_type_error((), 0)
