Commit c858f36a authored by Robert Bradshaw's avatar Robert Bradshaw

Fix ctuple comparison.

--HG--
extra : transplant_source : %1D%D3w%5B%A2%3E%5D%E2S%F8%BB%BAql1%D3%E9%D9%22%83
parent d49f604f
...@@ -10501,11 +10501,10 @@ class CmpNode(object): ...@@ -10501,11 +10501,10 @@ class CmpNode(object):
if new_common_type is None: if new_common_type is None:
# fall back to generic type compatibility tests # fall back to generic type compatibility tests
if type1 == type2: if type1.is_ctuple or type2.is_ctuple:
if type1.is_ctuple: new_common_type = py_object_type
new_common_type = py_object_type elif type1 == type2:
else: new_common_type = type1
new_common_type = type1
elif type1.is_pyobject or type2.is_pyobject: elif type1.is_pyobject or type2.is_pyobject:
if type2.is_numeric or type2.is_string: if type2.is_numeric or type2.is_string:
if operand2.check_for_coercion_error(type1, env): if operand2.check_for_coercion_error(type1, env):
......
...@@ -120,6 +120,17 @@ def test_equality((int, int) ab, (int, int) cd, (int, int) ef): ...@@ -120,6 +120,17 @@ def test_equality((int, int) ab, (int, int) cd, (int, int) ef):
""" """
return ab < cd <= ef return ab < cd <= ef
def test_equality_different_types((double, int) ab, (int, int) cd, (long, int) ef):
"""
>>> test_equality((1, 2), (3, 4), (5, 6))
True
>>> test_equality((1, 2), (3, 4), (3, 4))
True
>>> test_equality((3, 4), (3, 4), (3, 4))
False
"""
return ab < cd <= ef
def test_binop((int, int) ab, (double, double) cd): def test_binop((int, int) ab, (double, double) cd):
""" """
>>> test_binop((1, 2), (3, 4)) >>> test_binop((1, 2), (3, 4))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment