[pypy-commit] pypy default: Added __objclass__ to methods.

alex_gaynor noreply at buildbot.pypy.org
Tue Jun 28 09:28:19 CEST 2011


Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: 
Changeset: r45154:5eec40f4a153
Date: 2011-06-28 00:34 -0700
http://bitbucket.org/pypy/pypy/changeset/5eec40f4a153/

Log:	Added __objclass__ to methods.

diff --git a/pypy/interpreter/test/test_typedef.py b/pypy/interpreter/test/test_typedef.py
--- a/pypy/interpreter/test/test_typedef.py
+++ b/pypy/interpreter/test/test_typedef.py
@@ -213,6 +213,8 @@
         bm = A().m
         assert bm.__func__ is bm.im_func
         assert bm.__self__ is bm.im_self
+        assert bm.__objclass__ is bm.im_class is A
         assert bm.__doc__ == "aaa"
         assert bm.x == 3
         raises(AttributeError, setattr, bm, 'x', 15)
+        assert [].append.__objclass__ is list
\ No newline at end of file
diff --git a/pypy/interpreter/typedef.py b/pypy/interpreter/typedef.py
--- a/pypy/interpreter/typedef.py
+++ b/pypy/interpreter/typedef.py
@@ -771,6 +771,7 @@
     im_self  = interp_attrproperty_w('w_instance', cls=Method),
     __self__ = interp_attrproperty_w('w_instance', cls=Method),
     im_class = interp_attrproperty_w('w_class', cls=Method),
+    __objclass__ = interp_attrproperty_w('w_class', cls=Method),
     __getattribute__ = interp2app(Method.descr_method_getattribute),
     __eq__ = interp2app(Method.descr_method_eq),
     __ne__ = descr_generic_ne,


More information about the pypy-commit mailing list