[pypy-svn] r13880 - in pypy/dist/pypy/rpython: . test
mwh at codespeak.net
mwh at codespeak.net
Sat Jun 25 18:23:25 CEST 2005
Author: mwh
Date: Sat Jun 25 18:23:24 2005
New Revision: 13880
Modified:
pypy/dist/pypy/rpython/rclass.py
pypy/dist/pypy/rpython/test/test_rpbc.py
Log:
enable test of calling a bound method attached to a constant.
the reason the last checkin wasn't complete has to do with .setup()
not being called on classes we only see as instances of constants.
Modified: pypy/dist/pypy/rpython/rclass.py
==============================================================================
--- pypy/dist/pypy/rpython/rclass.py (original)
+++ pypy/dist/pypy/rpython/rclass.py Sat Jun 25 18:23:24 2005
@@ -380,6 +380,7 @@
try:
return self.prebuiltinstances[id(value)][1]
except KeyError:
+ self.setup()
result = malloc(self.object_type)
self.prebuiltinstances[id(value)] = value, result
self.initialize_prebuilt_instance(value, classdef, result)
Modified: pypy/dist/pypy/rpython/test/test_rpbc.py
==============================================================================
--- pypy/dist/pypy/rpython/test/test_rpbc.py (original)
+++ pypy/dist/pypy/rpython/test/test_rpbc.py Sat Jun 25 18:23:24 2005
@@ -214,12 +214,13 @@
res = ev_f1(1)
assert res == 7
-def dont_test_rpbc_bound_method_static_call():
+def test_rpbc_bound_method_static_call():
class R:
def meth(self):
return 0
r = R()
+ m = r.meth
def fn():
- return r.meth()
+ return m()
res = interpret(fn, [])
assert res == 0
More information about the Pypy-commit
mailing list