decoratorfor exampleeither of the last two decoration lines in the following will suffice if coded just before our class definition--the first uses decorator argument defaultsand the second provides one explicitly@decorateall(tracerdecorate all with tracer @decorateall(timer()@decorateall(timer(label='@@')decorate all with timerdefaults same but pass decorator argument as beforelet' use the last of these decorator lines and add the following at the end of the script to test our example with different decorator (better schemes are possible on both the testing and timing fronts hereof coursebut we're at endimprove as desired)if using timertotal time per method print('-'* print(' fperson __init__ alltimeprint(' fperson giveraise alltimeprint(' fperson lastname alltimethe same sort of output appears--for every method we get timing data for each and all callsbut we've passed different label argument to the timer decoratorc:\codepy - decoall-deco-any py @@__init__ @@__init__ bob smith sue jones @@giveraise @@lastname @@lastname smith jones finallyit' possible to combine decorators such that each runs per method callbut it will likely require changes to those we've coded here as isnesting calls to them directly winds up tracing or timing the other' creation-time applicationlisting the two on separate lines results in tracing or timing the other' wrapper before running the original methodand metaclasses seem to fare no better on this front@decorateall(tracer(timer(label='@@'))class persontraces applying the timer @decorateall(tracer@decorateall(timer(label='@@')class persontraces oncall wrappertimes methods @decorateall(timer(label='@@') metaclasses