[Python-bugs-list] [ python-Bugs-535444 ] super() broken with classmethods
noreply@sourceforge.net
noreply@sourceforge.net
Tue, 26 Mar 2002 14:13:29 -0800
Bugs item #535444, was opened at 2002-03-26 22:13
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=535444&group_id=5470
Category: Python Interpreter Core
Group: Python 2.2.1 candidate
Status: Open
Resolution: None
Priority: 5
Submitted By: Phillip J. Eby (pje)
Assigned to: Nobody/Anonymous (nobody)
Summary: super() broken with classmethods
Initial Comment:
Using super() in a classmethod breaks in Python 2.2.
Apparently, when super looks up an attribute from the
__mro__ sequence, it calls the found descriptor's
__get__ with the descriptor itself as the 'type'
argument, which breaks horribly with class methods
(which always binds to the type argument).
Presumably, the fix is to pass a NULL type argument,
which should work with the recent fixes to the
classmethod's __get__ logic. In other words, this code
in the super_getattro function Objects/typeobject.c:
tmp = f(res, su->obj, res);
should probably actually read:
tmp = f(res, su->obj, NULL);
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=535444&group_id=5470