mirascope.core.base.merge_decorators¶
merge_decorators
¶
merge_decorators(
decorator: Callable[
[Callable[_P, _R]], Callable[_WP, _WR]
],
*additional_decorators: Callable[[Callable], Callable]
) -> Callable[
[], Callable[[Callable[_P, _R]], Callable[_WP, _WR]]
]
Combines multiple decorators into a single decorator factory.
This function allows you to merge multiple decorators into a single decorator factory. The decorators are applied in the order they are passed to the function. All function metadata (e.g. docstrings, function name) is preserved through the decoration chain.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
decorator |
Callable[[Callable[_P, _R]], Callable[_WP, _WR]]
|
The base decorator that determines the type signature of the decorated function. |
required |
*additional_decorators |
Callable[[Callable], Callable]
|
Additional decorators to be merged with the base decorator. |
()
|
Returns:
Type | Description |
---|---|
Callable[[], Callable[[Callable[_P, _R]], Callable[_WP, _WR]]]
|
A decorator factory function that applies all decorators in the specified order. |