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

pedronis at codespeak.net pedronis at codespeak.net
Tue Apr 19 16:05:56 CEST 2005


Author: pedronis
Date: Tue Apr 19 16:05:56 2005
New Revision: 10858

Modified:
   pypy/dist/pypy/annotation/builtin.py
Log:
perhaps saner annotation for isinstance(., long) (?)



Modified: pypy/dist/pypy/annotation/builtin.py
==============================================================================
--- pypy/dist/pypy/annotation/builtin.py	(original)
+++ pypy/dist/pypy/annotation/builtin.py	Tue Apr 19 16:05:56 2005
@@ -62,7 +62,13 @@
         else:
             if typ == long:
                 getbookkeeper().warning("isinstance(., long) is not RPython")
-                typ = int # XXX as we did before
+                if s_obj.is_constant():
+                    r.const = isinstance(s_obj.const, long)
+                else:
+                    if type(s_obj) is not SomeObject: # only SomeObjects could be longs
+                        r.const = False
+                return r
+                
             assert not issubclass(typ, (int,long)) or typ in (bool, int), (
                 "for integers only isinstance(.,int|r_uint) are supported")
             if s_obj.is_constant():



More information about the Pypy-commit mailing list