(self, func=None, *, result_format=None)
return _decorator if func is None else _decorator(func)
Decorator for creating an extension point.
Decorator for creating an extension point.
Decorator for creating an extension point .
def extension_point(self, func=None, *, result_format=None):
        """Decorator for creating an extension point."""
        def _decorator(func):
            if not callable(func):
                raise ExtensionError(f"Extension point must be callable: {func!r}")

            name = func.__name__
            formatter = RESULT_FORMATTERS[result_format] if result_format else None
            point = ExtensionPoint(self, name, func, result_formatter=formatter)
            self.registry[name] = point
            return point

        return _decorator if func is None else _decorator(func)
def extension_point ( self , func = None , * , result_format = None ) : def _decorator ( func ) : if not callable ( func ) : raise ExtensionError ( f"Extension point must be callable: {func!r}" ) name = func . __name__ formatter = RESULT_FORMATTERS [ result_format ] if result_format else None point = ExtensionPoint ( self , name , func , result_formatter = formatter ) self . registry [ name ] = point return point return _decorator if func is None else _decorator ( func )