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

arigo at codespeak.net arigo at codespeak.net
Thu May 27 14:16:11 CEST 2004


Author: arigo
Date: Thu May 27 14:16:11 2004
New Revision: 4676

Modified:
   pypy/trunk/src/pypy/annotation/binaryop.py
Log:
A few more integer operators.


Modified: pypy/trunk/src/pypy/annotation/binaryop.py
==============================================================================
--- pypy/trunk/src/pypy/annotation/binaryop.py	(original)
+++ pypy/trunk/src/pypy/annotation/binaryop.py	Thu May 27 14:16:11 2004
@@ -12,8 +12,9 @@
 
 
 # XXX unify this with ObjSpace.MethodTable
-BINARY_OPERATIONS = set(['add', 'sub', 'mul', 'getitem', 'setitem',
-                         'inplace_add',
+BINARY_OPERATIONS = set(['add', 'sub', 'mul', 'div', 'mod',
+                         'getitem', 'setitem',
+                         'inplace_add', 'inplace_sub',
                          'lt', 'le', 'eq', 'ne', 'gt', 'ge',
                          'union'])
 
@@ -29,6 +30,9 @@
     def inplace_add((obj1, obj2)):
         return pair(obj1, obj2).add()   # default
 
+    def inplace_sub((obj1, obj2)):
+        return pair(obj1, obj2).sub()   # default
+
 
 class __extend__(pairtype(SomeInteger, SomeInteger)):
 
@@ -38,7 +42,7 @@
     def add((int1, int2)):
         return SomeInteger(nonneg = int1.nonneg and int2.nonneg)
 
-    mul = add
+    mul = div = mod = add
 
     def sub((int1, int2)):
         return SomeInteger()



More information about the Pypy-commit mailing list