

def on(self, event, *handlers):
    'register a handler to a specified event'

    def _on_wrapper(*handlers):
        'wrapper for on decorator'
        self.events[event].extend(handlers)
        return handlers[0]
    if handlers:
        return _on_wrapper(*self)
    return _on_wrapper

dataset/ETHPy150Open timofurrer/pyobservable/observable/core.py Observable.on/VarMisuse@57/86 `handlers`->`self`