def M1(): """ Helper function that returns a module-like thing with two signals defined using :meth:`Signal.define` """ on_foo, on_bar = get_foo_bar() ns = NS() ns.on_foo_func = on_foo ns.on_foo = Signal.define(on_foo) ns.on_bar = Signal.define(on_bar) return ns
class C1(object): """ Helper class with two signals defined using :meth:`Signal.define` """ def on_foo(self, *args, **kwargs): """ A signal accepting (ignoring) arbitrary arguments """ on_foo_func = on_foo on_foo = Signal.define(on_foo) @Signal.define def on_bar(self): """