Steven Bethard wrote: > I think you want to define __get__ on your Observable class so that it > can do the right thing when the method is bound to the instance: > > >>> class Observable(object): > [snip] > ... def __get__(self, obj, cls=None): > ... if obj is None: > ... return self > ... else: > ... func = self.func.__get__(obj, cls) > ... return Observable(func, obj, self.observers) > [snip] Great, that does it! Thanks a billion :)
It took me quite some time understanding what the __get__ method does, but I think now I figured it out. I've made a quantum leap in my understanding of Python (esp. method binding) with this! Awesome! :) /W -- http://mail.python.org/mailman/listinfo/python-list