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

antocuni at codespeak.net antocuni at codespeak.net
Mon Jan 29 16:09:27 CET 2007


Author: antocuni
Date: Mon Jan 29 16:09:26 2007
New Revision: 37542

Modified:
   pypy/dist/pypy/annotation/binaryop.py
Log:
Pay attention to can_be_None when making the union of two SomeOOInstances.



Modified: pypy/dist/pypy/annotation/binaryop.py
==============================================================================
--- pypy/dist/pypy/annotation/binaryop.py	(original)
+++ pypy/dist/pypy/annotation/binaryop.py	Mon Jan 29 16:09:26 2007
@@ -798,7 +798,7 @@
     def union((r1, r2)):
         common = ootype.commonBaseclass(r1.ootype, r2.ootype)
         assert common is not None, 'Mixing of incompatible instances %r, %r' %(r1.ootype, r2.ootype)
-        return SomeOOInstance(common)
+        return SomeOOInstance(common, can_be_None=r1.can_be_None or r2.can_be_None)
 
 class __extend__(pairtype(SomeOOClass, SomeOOClass)):
     def union((r1, r2)):



More information about the Pypy-commit mailing list