Open windslinux opened 4 years ago
from pubsub import pub
def localCall(func): def real_func(data): print("In real function : {}".format(data)) func(data) return real_func
def localUpdate(data): print("In local update")
pub.subscribe(localCall(localUpdate), "update") pub.sendMessage("update", data="updateUI")
In the example above, the function localUpdate can't be called. I have no idea why the closure function can't be called?
from pubsub import pub
def localCall(func): def real_func(data): print("In real function : {}".format(data)) func(data) return real_func
def localUpdate(data): print("In local update")
pub.subscribe(localCall(localUpdate), "update") pub.sendMessage("update", data="updateUI")
In the example above, the function localUpdate can't be called. I have no idea why the closure function can't be called?