Open TTimo opened 9 years ago
I suspect the problem is knowing whether a callable supports keyword arguments. The inspect
library doesn't seem to know how to check this.
One possibility is to take the Erlang approach and just "let it crash" if it turns out a callable doesn't support keywords. Trouble is the signal in question might be a very rare one and it'll only be some time later that you find there's a problem.
I made a fork of signalslot
that accepts a Slot
object which doesn't actually bother to check whether the thing it is passed takes keywords, then I found I had to add a special case to handle this very problem in the Signal
class.
Could you curry your callable maybe ?
Okay, I'm a little lost, what is meant by "curry your callable"?
I was thinking of this curry command https://github.com/django/django/blob/master/django/utils/functional.py#L10
Just suggesting as a temporary workaround.
nifty little module!
Would it be possible to support callables instead of just functions - I ran into this use case:
Basically I wanted to specialize a signal handler from a generic function with a partial application in between. Error is: