Steven said:
Congratulations, you found the trivial case.
What other cases are there? It takes any callable, and returns a function
that calls the callable. What else do you need? [...] What am I missing?
The words "stupidly implemented" above?
I have to set the callback in more than one place and (believe it or not) the
library behaves (slightly) different when you pass different callbacks. The
right way to use the above approach would be to wrap the callback right before
passing it into the library - which I can't do, as that would give me a
different function object each time. Also, most of the time I actually pass a
function, except in one case where I need a wrapper for an existing function.
So the solution I chose was to change the original wrapper class itself
instead of re-wrapping it, so that I get the expected object right away.
As usual, it's all about the details.
Stefan