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

arigo at codespeak.net arigo at codespeak.net
Wed Dec 8 13:48:01 CET 2004


Author: arigo
Date: Wed Dec  8 13:48:00 2004
New Revision: 7774

Modified:
   pypy/trunk/src/pypy/annotation/binaryop.py
Log:
Patch from odie, with 'xor' fixed.


Modified: pypy/trunk/src/pypy/annotation/binaryop.py
==============================================================================
--- pypy/trunk/src/pypy/annotation/binaryop.py	(original)
+++ pypy/trunk/src/pypy/annotation/binaryop.py	Wed Dec  8 13:48:00 2004
@@ -20,6 +20,7 @@
 
 # XXX unify this with ObjSpace.MethodTable
 BINARY_OPERATIONS = set(['add', 'sub', 'mul', 'div', 'mod',
+                         'and_', 'or_', 'xor',
                          'getitem', 'setitem',
                          'inplace_add', 'inplace_sub',
                          'lt', 'le', 'eq', 'ne', 'gt', 'ge', 'is_',
@@ -125,15 +126,15 @@
         return SomeInteger(nonneg = int1.nonneg and int2.nonneg,
                            unsigned = int1.unsigned or int2.unsigned)
 
-    def add((int1, int2)):
-        return SomeInteger(nonneg = int1.nonneg and int2.nonneg,
-                           unsigned = int1.unsigned or int2.unsigned)
-
-    mul = div = mod = add
+    add = mul = div = mod = or_ = xor = union
 
     def sub((int1, int2)):
         return SomeInteger(unsigned = int1.unsigned or int2.unsigned)
 
+    def and_((int1, int2)):
+        return SomeInteger(nonneg = int1.nonneg or int1.nonneg,
+                           unsigned = int1.unsigned or int2.unsigned)
+
 
 class __extend__(pairtype(SomeBool, SomeBool)):
 



More information about the Pypy-commit mailing list