
Oct. 30, 2014
9:03 a.m.
On Oct 30, 2014, at 1:23, Jonas Wielicki <j.wielicki@sotecware.net> wrote:
(only referring to the second use case here)
On 30.10.2014 09:07, Antony Lee wrote:
[snip] self.any_callable_signal.connect(lambda f: f()) # <- operator.call seems to express this better. def call_in_gui_thread(self, func): self.any_callable_signal.emit(func)
How is that different from directly passing f? Or use functools.partial in case you need to pass additional, fixed arguments to f.
He's passing a function that takes any function f and calls it. That's not the same as passing any particular function. Maybe it's more obvious if you compare: lambda f: f() lambda: f()