wrap_func_as_method

glotaran.model.util.wrap_func_as_method(cls: Any, name: str = None, annotations: dict[str, type] = None, doc: str = None) Callable[[DecoratedFunc], DecoratedFunc][source]

A decorator to wrap a function as class method.

Notes

Only for internal use.

Parameters
  • cls – The class in which the function will be wrapped.

  • name – The name of method. If None, the original function’s name is used.

  • annotations – The annotations of the method. If None, the original function’s annotations are used.

  • doc – The documentation of the method. If None, the original function’s documentation is used.