def class_register(cls):
    """Class decorator that allows to map LSP method names to class methods."""
    cls.handler_registry = {}
    for method_name in dir(cls):
        method = getattr(cls, method_name)
        if hasattr(method, '_handle'):
            cls.handler_registry.update({method._handle: method_name})
    return cls
def class_register ( cls ) : cls . handler_registry = { } for method_name in dir ( cls ) : method = getattr ( cls , method_name ) if hasattr ( method , '_handle' ) : cls . handler_registry . update ( { method . _handle : method_name } ) return cls
Class decorator that allows to map LSP method names to class methods.