[pypy-svn] r7632 - pypy/trunk/src/pypy/translator
arigo at codespeak.net
arigo at codespeak.net
Tue Nov 23 18:17:55 CET 2004
Author: arigo
Date: Tue Nov 23 18:17:54 2004
New Revision: 7632
Modified:
pypy/trunk/src/pypy/translator/genpyrex.py
Log:
Adapted genpyrex.py to the lack of SomeCallables.
Modified: pypy/trunk/src/pypy/translator/genpyrex.py
==============================================================================
--- pypy/trunk/src/pypy/translator/genpyrex.py (original)
+++ pypy/trunk/src/pypy/translator/genpyrex.py Tue Nov 23 18:17:54 2004
@@ -6,7 +6,7 @@
from pypy.objspace.flow.model import Variable, Constant, UndefinedConstant
from pypy.objspace.flow.model import mkentrymap, last_exception
from pypy.translator.annrpython import RPythonAnnotator
-#from pypy.annotation.model import SomeCallable
+from pypy.annotation.model import SomePBC
from pypy.annotation.factory import isclassdef
import inspect
@@ -417,11 +417,11 @@
empty = True
for attr, attrdef in cls.attrs.items():
s_value = attrdef.s_value
- if isinstance(s_value, SomeCallable):
- for py_fun,fun_class in s_value.callables.items():
- assert isclassdef(fun_class), (
- "%r must have a classdef" % py_fun)
- delay_methods.setdefault(fun_class,[]).append(py_fun)
+ if isinstance(s_value, SomePBC):
+ for py_fun,fun_class in s_value.prebuiltinstances.items():
+ assert isclassdef(fun_class), ("don't support "
+ "prebuilt constants like %r" % py_fun)
+ delay_methods.setdefault(fun_class,[]).append(py_fun)
else:
vartype=self._gettypename(s_value.knowntype)
self.putline("cdef public %s %s" % (vartype, attr))
More information about the Pypy-commit
mailing list