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

hpk at codespeak.net hpk at codespeak.net
Thu Nov 18 18:00:07 CET 2004


Author: hpk
Date: Thu Nov 18 18:00:07 2004
New Revision: 7393

Modified:
   pypy/trunk/src/pypy/annotation/binaryop.py
Log:
allow the analysis of "SomeXXX is None" to return immutablevalue(False) 
if SomeXXX is not of class SomeObject (all other classes should not 
be None)
 


Modified: pypy/trunk/src/pypy/annotation/binaryop.py
==============================================================================
--- pypy/trunk/src/pypy/annotation/binaryop.py	(original)
+++ pypy/trunk/src/pypy/annotation/binaryop.py	Thu Nov 18 18:00:07 2004
@@ -104,6 +104,9 @@
         if obj2.is_constant():
             if const is not None:
                 return immutablevalue(obj1.const is obj2.const)
+            # we are in the case "SomeXXX is None" here 
+            if obj2.const is None and obj1.__class__ != SomeObject: 
+                return immutablevalue(False) 
             const = obj2
             var = obj1
             vararg = 0



More information about the Pypy-commit mailing list