wx.lib.pubsub.utils.misc.Callback¶
This can be used to wrap functions that are referenced by class data if the data should be called as a function. E.g. given >>> def func(): pass >>> class A: ….def __init__(self): self.a = func then doing >>> boo=A(); boo.a() will fail since Python will try to call a() as a method of boo, whereas a() is a free function. But if you have instead “self.a = Callback(func)”, then “boo.a()” works as expected.
Class Hierarchy¶
Methods Summary¶
Initialize self. See help(type(self)) for accurate signature. |
Class API¶
- class Callback¶
This can be used to wrap functions that are referenced by class data if the data should be called as a function. E.g. given >>> def func(): pass >>> class A: ….def __init__(self): self.a = func then doing >>> boo=A(); boo.a() will fail since Python will try to call a() as a method of boo, whereas a() is a free function. But if you have instead “self.a = Callback(func)”, then “boo.a()” works as expected.
Methods¶
- __init__(self, callable_)¶
Initialize self. See help(type(self)) for accurate signature.