[pypy-svn] r53226 - in pypy/branch/jit-hotpath/pypy/rpython/ootypesystem: . test
antocuni at codespeak.net
antocuni at codespeak.net
Tue Apr 1 10:15:25 CEST 2008
Author: antocuni
Date: Tue Apr 1 10:15:23 2008
New Revision: 53226
Modified:
pypy/branch/jit-hotpath/pypy/rpython/ootypesystem/ootype.py
pypy/branch/jit-hotpath/pypy/rpython/ootypesystem/test/test_ootype.py
Log:
attach the name of the method to the _bound_meth object (only for
builtin types so far)
Modified: pypy/branch/jit-hotpath/pypy/rpython/ootypesystem/ootype.py
==============================================================================
--- pypy/branch/jit-hotpath/pypy/rpython/ootypesystem/ootype.py (original)
+++ pypy/branch/jit-hotpath/pypy/rpython/ootypesystem/ootype.py Tue Apr 1 10:15:23 2008
@@ -1163,7 +1163,9 @@
TYPE = object.__getattribute__(self, "_TYPE")
_, meth = TYPE._lookup(name)
if meth is not None:
- return meth._bound(TYPE, self)
+ res = meth._bound(TYPE, self)
+ res._name = name
+ return res
return object.__getattribute__(self, name)
Modified: pypy/branch/jit-hotpath/pypy/rpython/ootypesystem/test/test_ootype.py
==============================================================================
--- pypy/branch/jit-hotpath/pypy/rpython/ootypesystem/test/test_ootype.py (original)
+++ pypy/branch/jit-hotpath/pypy/rpython/ootypesystem/test/test_ootype.py Tue Apr 1 10:15:23 2008
@@ -213,6 +213,12 @@
METH = typeOf(meth)
assert METH.SELFTYPE is LIST
+def test_bound_method_name():
+ LIST = List(Signed)
+ lst = new(LIST)
+ meth = lst.ll_getitem_fast
+ assert meth._name == 'll_getitem_fast'
+
def test_explicit_name_clash():
C = Instance("test", ROOT, {})
More information about the pypy-svn
mailing list