-
Notifications
You must be signed in to change notification settings - Fork 49
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
fix: prevent dupe calls #545
Conversation
ugh... this is just a real annoying problem.
basically, this all just further emphasizes that the I really don't know the best solution here. |
one possibility here is just to temporarily go back to the previous behavior (that I absolutely thing was incorrect behavior) of calling callbacks registered for That's a big bummer, cause it's just obviously wrong behavior. @Czaki, what do you think here? |
Why not just check presence of callback in lust before append? Registration type should be rare operation and such list should be short. |
Because if we're dealing with sets as keys you now have to check all keys for a subset match, remember which ones matched, etc... |
It's not that it's not possible, it's just getting uglier and uglier for something that was an accidental "feature/bug" to begin with |
Because of def test_proper_call():
@magicgui
def func(a: int, b: int) -> int:
return a + b
mock1 = Mock()
mock2 = Mock()
register_type(int, return_callback=mock1)
register_type(Optional[int], return_callback=mock2)
func(1, 2)
mock2.assert_called_once()
mock1.assert_called_once() |
closing, see #546 |
trying to fix the duplicate call thing mentioned in #544 (review)