Author: Armin Rigo <ar...@tunes.org>
Branch: kill-someobject
Changeset: r57927:d867247c7bc9
Date: 2012-10-08 14:57 +0200
http://bitbucket.org/pypy/pypy/changeset/d867247c7bc9/

Log:    (fijal, arigo) Fix one of the failures: tuple equality now correctly
        computes the union of the two tuples.

diff --git a/pypy/annotation/binaryop.py b/pypy/annotation/binaryop.py
--- a/pypy/annotation/binaryop.py
+++ b/pypy/annotation/binaryop.py
@@ -550,7 +550,9 @@
 
     def union((tup1, tup2)):
         if len(tup1.items) != len(tup2.items):
-            return SomeObject()
+            raise Exception("cannot take the union of a tuple of length %d "
+                            "and a tuple of length %d" % (len(tup1.items),
+                                                          len(tup2.items)))
         else:
             unions = [unionof(x,y) for x,y in zip(tup1.items, tup2.items)]
             return SomeTuple(items = unions)
@@ -558,6 +560,20 @@
     def add((tup1, tup2)):
         return SomeTuple(items = tup1.items + tup2.items)
 
+    def eq(tup1tup2):
+        tup1tup2.union()
+        return s_Bool
+    ne = eq
+
+    def lt((tup1, tup2)):
+        raise Exception("unsupported: (...) < (...)")
+    def le((tup1, tup2)):
+        raise Exception("unsupported: (...) <= (...)")
+    def gt((tup1, tup2)):
+        raise Exception("unsupported: (...) > (...)")
+    def ge((tup1, tup2)):
+        raise Exception("unsupported: (...) >= (...)")
+
 
 class __extend__(pairtype(SomeDict, SomeDict)):
 
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to