-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
allow passing a function to CallbackRegistry.disconnect_func
#30844
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
base: main
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modulo fixing the change notes.
| ``CallbackRegistry.disconnect_func`` has been removed; use | ||
| ``disconnect(func, signal=...)`` instead. |
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.
Please remove. Was this pedantic AI 😄 ?
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.
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
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.
| @@ -0,0 +1,20 @@ | |||
| ``CallbackRegistry.disconnect_func`` to disconnect callbacks by function | |||
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.
Please remove.
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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