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

pedronis at codespeak.net pedronis at codespeak.net
Thu Feb 24 19:04:44 CET 2005


Author: pedronis
Date: Thu Feb 24 19:04:44 2005
New Revision: 9490

Modified:
   pypy/dist/pypy/annotation/builtin.py
   pypy/dist/pypy/annotation/model.py
Log:
some more builtins



Modified: pypy/dist/pypy/annotation/builtin.py
==============================================================================
--- pypy/dist/pypy/annotation/builtin.py	(original)
+++ pypy/dist/pypy/annotation/builtin.py	Thu Feb 24 19:04:44 2005
@@ -3,6 +3,7 @@
 """
 
 import types
+import sys
 from pypy.tool.ansi_print import ansi_print
 from pypy.annotation.model import SomeInteger, SomeObject, SomeChar, SomeBool
 from pypy.annotation.model import SomeList, SomeString, SomeTuple, SomeSlice
@@ -44,6 +45,12 @@
 def builtin_id(o):
     return SomeInteger()
 
+def builtin_hex(o):
+    return SomeString()
+
+def builtin_abs(o):
+    return o.__class__()
+
 def builtin_unicode(s_obj): 
     return SomeString() 
 
@@ -167,6 +174,9 @@
 def exception_init(s_self, *args):
     s_self.setattr(immutablevalue('args'), SomeTuple(args))
 
+def count(s_obj):
+    return SomeInteger()
+
 # collect all functions
 import __builtin__
 BUILTIN_ANALYZERS = {}
@@ -178,4 +188,4 @@
 BUILTIN_ANALYZERS[pypy.objspace.std.restricted_int.r_int] = builtin_int
 BUILTIN_ANALYZERS[pypy.objspace.std.restricted_int.r_uint] = restricted_uint
 BUILTIN_ANALYZERS[Exception.__init__.im_func] = exception_init
-
+BUILTIN_ANALYZERS[sys.getrefcount] = count

Modified: pypy/dist/pypy/annotation/model.py
==============================================================================
--- pypy/dist/pypy/annotation/model.py	(original)
+++ pypy/dist/pypy/annotation/model.py	Thu Feb 24 19:04:44 2005
@@ -66,6 +66,7 @@
     
     def contains(self, other):
         return self == other or pair(self, other).union() == self
+
     def is_constant(self):
         return hasattr(self, 'const')
 



More information about the Pypy-commit mailing list