Closed coldfix closed 6 years ago
Don't know if it is really useful, but I can think of a few instances, where it might have helped me out. For an example of what I am thinking about:
class Foo: @event def bar(self): pass def baz(inst): print("baz: ", inst) Foo.bar.connect(baz) foo = Foo() foo.bar() # baz: <Foo object at ...>
So, hooking up through the class adds the observer to all instances?
Yes, effectively that. It can be implemented with a separate class specific list as done here.
Don't know if it is really useful, but I can think of a few instances, where it might have helped me out. For an example of what I am thinking about: