[pypy-svn] r17073 - pypy/dist/pypy/annotation

cfbolz at codespeak.net cfbolz at codespeak.net
Mon Aug 29 21:12:15 CEST 2005


Author: cfbolz
Date: Mon Aug 29 21:12:13 2005
New Revision: 17073

Modified:
   pypy/dist/pypy/annotation/binaryop.py
Log:
unions between addresses and someimpossiblevalues and someobjects


Modified: pypy/dist/pypy/annotation/binaryop.py
==============================================================================
--- pypy/dist/pypy/annotation/binaryop.py	(original)
+++ pypy/dist/pypy/annotation/binaryop.py	Mon Aug 29 21:12:13 2005
@@ -684,3 +684,19 @@
     def sub((s_addr, s_int)):
         return SomeAddress(is_null=False)
 
+class __extend__(pairtype(SomeAddress, SomeImpossibleValue)):
+    def union((s_addr, s_imp)):
+        return s_addr
+
+class __extend__(pairtype(SomeImpossibleValue, SomeAddress)):
+    def union((s_imp, s_addr)):
+        return s_addr
+
+class __extend__(pairtype(SomeAddress, SomeObject)):
+    def union((s_addr, s_obj)):
+        raise UnionError, "union of address and anything else makes no sense"
+
+class __extend__(pairtype(SomeObject, SomeAddress)):
+    def union((s_obj, s_addr)):
+        raise UnionError, "union of address and anything else makes no sense"
+



More information about the Pypy-commit mailing list