bpo-46764: Fix wrapping bound method with @classmethod#31367
bpo-46764: Fix wrapping bound method with @classmethod#31367rhettinger merged 3 commits intopython:mainfrom
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 |
JelleZijlstra
left a comment
There was a problem hiding this comment.
@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