Repository navigation
allow passing a function to CallbackRegistry.disconnect_func - #30844
Conversation
|
The failing tests seem unrelated? |
|
Would it make sense to fold this into the existing And an one of these for event-specific disconnecting API-wise this feels more intuitive than a separate function. If the implementation gets too messy, you should be able to dispatch to a helper function based on the parameters. |
|
That's a nice suggestion. I have implemented it. |
timhoffm
left a comment
There was a problem hiding this comment.
Modulo fixing the change notes.
| ``CallbackRegistry.disconnect_func`` has been removed; use | ||
| ``disconnect(func, signal=...)`` instead. |
There was a problem hiding this comment.
Please remove. Was this pedantic AI 😄 ?
There was a problem hiding this comment.
aghh. that's embarassing. indeed.
The aggressive back compatibility from changes within a session has to be one of my least favorite aspects of AI code tools
| @@ -0,0 +1,20 @@ | |||
| ``CallbackRegistry.disconnect_func`` to disconnect callbacks by function | |||
There was a problem hiding this comment.
whoops forgot to update this whats new with the most recent changes.
Are you saying that this should no longer get a whatsnews, or just I should update it to use disconnect?
There was a problem hiding this comment.
Yes, update is the correct way.
PR summary
Make it more convenient to disconnect a callback by allowing passing back the function instead of requiring keeping track of the callback_id.
disconnectto re-use the duplicated logic in_remove_proxyI'm not 100% on the naming, but that is apparently what I thought was good in 2022, so trusting prior me.
Closes: #23306
AI 🤖 : Ideas all mine, actual code changes by claude. I have reviewed every changed line
PR checklist