stouputils.decorators.common module#

get_function_name(
func: CallableAny,
) str[source]#

Get the name of a function, returns “<unknown>” if the name cannot be retrieved.

get_wrapper_name(
decorator_name: str,
func: CallableAny,
) str[source]#

Get a descriptive name for a wrapper function.

Parameters:
  • decorator_name (str) – Name of the decorator

  • func (CallableAny) – Function being decorated

Returns:

Combined name for the wrapper function (e.g., “stouputils.decorators.handle_error@function_name”)

Return type:

str

set_wrapper_name(
wrapper: CallableAny,
name: str,
) None[source]#

Set the wrapper function’s visible name (code object name) for clearer tracebacks.

Parameters:
  • wrapper (CallableAny) – Wrapper function to update

  • name (str) – New name to set