[pypy-svn] r48849 - in pypy/dist/pypy/rpython: . test
xoraxax at codespeak.net
xoraxax at codespeak.net
Tue Nov 20 17:21:14 CET 2007
Author: xoraxax
Date: Tue Nov 20 17:21:14 2007
New Revision: 48849
Modified:
pypy/dist/pypy/rpython/rcontrollerentry.py
pypy/dist/pypy/rpython/test/test_controllerentry.py
Log:
(armin, alexander) Fix rtyping and actually using calls on controller instances.
Modified: pypy/dist/pypy/rpython/rcontrollerentry.py
==============================================================================
--- pypy/dist/pypy/rpython/rcontrollerentry.py (original)
+++ pypy/dist/pypy/rpython/rcontrollerentry.py Tue Nov 20 17:21:14 2007
@@ -31,6 +31,9 @@
def rtype_is_true(self, hop):
return self.controller.rtype_is_true(hop)
+ def rtype_simple_call(self, hop):
+ return self.controller.rtype_call(hop)
+
class __extend__(pairtype(ControlledInstanceRepr, Repr)):
Modified: pypy/dist/pypy/rpython/test/test_controllerentry.py
==============================================================================
--- pypy/dist/pypy/rpython/test/test_controllerentry.py (original)
+++ pypy/dist/pypy/rpython/test/test_controllerentry.py Tue Nov 20 17:21:14 2007
@@ -36,6 +36,9 @@
def setitem(self, obj, key, value):
value.append(obj + key)
+ def call(self, obj, arg):
+ return obj + arg
+
class Entry(ControllerEntry):
_about_ = C
_controller_ = C_Controller
@@ -96,14 +99,16 @@
lst = []
c = C(a)
c['foo'] = lst # side-effect on lst! well, it's a test
- return c['bar'], lst[0]
+ call_res = c("baz")
+ return c['bar'], lst[0], call_res
def test_getsetitem_annotate():
a = RPythonAnnotator()
s = a.build_types(fun3, [a.bookkeeper.immutablevalue("4")])
- assert s.const == ("4_bar", "4_foo")
+ assert s.const == ("4_bar", "4_foo", "4_baz")
def test_getsetitem_specialize():
res = interpret(fun3, ["4"])
assert ''.join(res.item0.chars) == "4_bar"
assert ''.join(res.item1.chars) == "4_foo"
+ assert ''.join(res.item2.chars) == "4_baz"
More information about the Pypy-commit
mailing list