(Backport to 2.3 maintenance branch)
vereq(dd.x, "hello")
vereq(super(DDsub, dd).x, 42)
+ # Ensure that super() lookup of descriptor from classmethod
+ # works (SF ID# 743627)
+
+ class Base(object):
+ aProp = property(lambda self: "foo")
+
+ class Sub(Base):
+ def test(klass):
+ return super(Sub,klass).aProp
+ test = classmethod(test)
+
+ veris(Sub.test(), Base.aProp)
+
+
def inherits():
if verbose: print "Testing inheritance from basic types..."
Py_INCREF(res);
f = res->ob_type->tp_descr_get;
if (f != NULL) {
- tmp = f(res, su->obj,
+ tmp = f(res,
+ /* Only pass 'obj' param if
+ this is instance-mode super
+ (See SF ID #743627)
+ */
+ (su->obj==su->obj_type
+ ? (PyObject *)NULL
+ : su->obj),
(PyObject *)starttype);
Py_DECREF(res);
res = tmp;