Skip to main content

method_decorator

Convert a function decorator into a method decorator

def method_decorator(
decorator: callable or iterable,
name: string = ""
) - > function

Convert a function decorator into a method decorator

Parameters

NameTypeDescription
decoratorcallable or iterableA single decorator function or an iterable of decorator functions to be applied to the target method.
namestring = ""The name of the method to decorate when applying this to a class; required if the decorated object is a class.

Returns

TypeDescription
functionA decorator function that can be applied to a class or a method to wrap the target logic with the provided decorator(s).