New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
super() broken with classmethods #36335
Comments
Using super() in a classmethod breaks in Python 2.2. Presumably, the fix is to pass a NULL type argument, tmp = f(res, su->obj, res); should probably actually read: tmp = f(res, su->obj, NULL); |
Logged In: YES Can you give an example of how to break it? Please also |
Logged In: YES class cm1(object):
def cmm(klass):
print klass
cmm = classmethod(cmm)
class cm2(cm1):
def cmm(klass):
super(cm2,klass).cmm()
cmm = classmethod(cmm)
cm2.cmm() The above code prints "<classmethod object at 0x00A9B930>", >>> cm1.cmm.im_self
<class '__main__.cm1'>
>>> cm2.cmm.im_self
<class '__main__.cm2'>
>>> super(cm2,cm2).cmm.im_self
<classmethod object at 0x00A9B930>
>>> The last item's im_self should of course be <class Note that if you use the pure Python example version of |
Logged In: YES Ugh. I just realized that my "presumable fix" is actually |
Logged In: YES Unless someone can come up with a obviously correct patch |
Logged In: YES Patch bpo-537536 submitted to fix this. "make test" output is |
Logged In: YES Assign to Guido. Bearing in mind that I haven't even tried to understand this |
Logged In: YES I was indeed just asking where to put it, and how to By the way, the bug/patch submission guidelines were a |
Logged In: YES OK, you've found the right place, good. The bug/patch guidlines are probably confusing because, I think you're doing fine! Now we just wait for Guido to |
Logged In: YES I should probably mention that I checked in Phillip's patch |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: