wraps¶
-
utilipy.
wraps
(wrapped: Callable, signature: Union[utilipy.utils.inspect.FullerSignature, None, bool] = True, docstring: Union[str, None, bool] = None, assigned: Sequence[str] = ('__module__', '__name__', '__qualname__', '__doc__', '__annotations__'), updated: Sequence[str] = ('__dict__'), _doc_fmt: Optional[dict] = None, _doc_style: Optional[Union[str, Callable]] = None)[source]¶ wraps()
, adding signature and docstring features.Decorator factory to apply
update_wrapper()
to a wrapper function.This is a convenience function to simplify applying
partial()
toupdate_wrapper()
.- Parameters
- wrapped: Callable
- signature: _FullerSig or bool or None, optional
True (default)
- docstring: str or bool or None, optional
None
- assigned: Sequence[str]
WRAPPER_ASSIGNMENTS,
- updated: Sequence[str]
WRAPPER_UPDATES,
- _doc_fmt: dict or None, optional
- _doc_style: Union[str, Callable, None], optional
- Returns
- partial
a decorator that invokes
update_wrapper()
with the decorated function as the wrapper argument and the arguments towraps()
as the remaining arguments. Default arguments are as forupdate_wrapper()
.