[pypy-svn] r7304 - pypy/trunk/src/pypy/annotation

arigo at codespeak.net arigo at codespeak.net
Tue Nov 16 19:05:13 CET 2004


Author: arigo
Date: Tue Nov 16 19:05:06 2004
New Revision: 7304

Modified:
   pypy/trunk/src/pypy/annotation/binaryop.py
Log:
Support for is_().


Modified: pypy/trunk/src/pypy/annotation/binaryop.py
==============================================================================
--- pypy/trunk/src/pypy/annotation/binaryop.py	(original)
+++ pypy/trunk/src/pypy/annotation/binaryop.py	Tue Nov 16 19:05:06 2004
@@ -18,7 +18,7 @@
 BINARY_OPERATIONS = set(['add', 'sub', 'mul', 'div', 'mod',
                          'getitem', 'setitem',
                          'inplace_add', 'inplace_sub',
-                         'lt', 'le', 'eq', 'ne', 'gt', 'ge',
+                         'lt', 'le', 'eq', 'ne', 'gt', 'ge', 'is_',
                          'union'])
 
 for opname in BINARY_OPERATIONS:
@@ -39,6 +39,14 @@
     def inplace_sub((obj1, obj2)):
         return pair(obj1, obj2).sub()   # default
 
+    def lt((obj1, obj2)): return SomeBool()
+    def le((obj1, obj2)): return SomeBool()
+    def eq((obj1, obj2)): return SomeBool()
+    def ne((obj1, obj2)): return SomeBool()
+    def gt((obj1, obj2)): return SomeBool()
+    def ge((obj1, obj2)): return SomeBool()
+    def is_((obj1, obj2)): return SomeBool()
+
 
 class __extend__(pairtype(SomeInteger, SomeInteger)):
     # unsignedness is considered a rare and contagious disease
@@ -56,13 +64,6 @@
     def sub((int1, int2)):
         return SomeInteger(unsigned = int1.unsigned or int2.unsigned)
 
-    def lt((int1, int2)): return SomeBool()
-    def le((int1, int2)): return SomeBool()
-    def eq((int1, int2)): return SomeBool()
-    def ne((int1, int2)): return SomeBool()
-    def gt((int1, int2)): return SomeBool()
-    def ge((int1, int2)): return SomeBool()
-
 
 class __extend__(pairtype(SomeBool, SomeBool)):
 



More information about the Pypy-commit mailing list