[Python-Dev] super() bug (?)
Samuele Pedroni
pedronis@bluewin.ch
Thu, 6 Mar 2003 18:21:40 +0100
>>> class C(object):
... def f(self): pass
...
>>> class D(C): pass
...
>>> D.f
<unbound method D.f>
>>> super(D,D).f
<bound method D.f of <class '__main__.D'>>
I think this should produce the same thing as D.f,
that means implementation-wise
f.__get__(None,D) should be called
not f.__get__(D,D).
_.__get__(None,D) would still do the right thing for static AND class methods:
>>> def g(cls): pass
...
>>> classmethod(g).__get__(None,D)
<bound method type.g of <class '__main__.D'>>