-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
bpo-46764: Fix wrapping bound method with @classmethod #31367
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
Conversation
Since python#8405, @classmethod now has special case behavior to call its argument's tp_descr_get if it exists. This breaks wrapping a bound method with it, since bound method's have a do-nothing tp_descr_get. Drop that do-nothing tp_descr_get.
Looking at the history, it looks like (Of course, things that directly check for the presence of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rhettinger do you still want to look at this? Would be good to get it in before the feature freeze (this Friday).
🤖 New build scheduled with the buildbot fleet by @JelleZijlstra for commit fcbe203 🤖 If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again. |
@JelleZijlstra I'm holding off on this one for a bit. As a bug fix, it can be committed after the feature freeze. The contending issue is that I'm working on deprecating the behavior — it is hard to use, it broke too many things, the fixed are making it worse, and since 3.10 we have a viable clean alternate path using |
Right, the descriptor behavior of classmethod has been problematic (#89519 (comment) for reference). I'll leave this to you. |
Since #8405, @classmethod now has special case behavior to call its
argument's tp_descr_get if it exists. This breaks wrapping a bound
method with it, since bound method's have a do-nothing tp_descr_get.
Drop that do-nothing tp_descr_get.
https://bugs.python.org/issue46764