examplewe could use either of the last two header lines in the following when defining our class--the first accepts the timer' default argumentsand the second specifies label textclass person(metaclass=decorateall(tracer))apply tracer class person(metaclass=decorateall(timer()))class person(metaclass=decorateall(timer(label='**')))apply timerdefaults decorator arguments notice that this scheme cannot support nondefault decorator arguments differing per method in the client classbut it can pass in decorator arguments that apply to all such methodsas done here to testuse the last of these metaclass declarations to apply the timerand add the following lines at the end of the script to see the timer' extra informational attributesif using timertotal time per method print('-'* print(' fperson __init__ alltimeprint(' fperson giveraise alltimeprint(' fperson lastname alltimethe new output is as follows--the metaclass wraps methods in timer decorators nowso we can tell how long each and every call takesfor every method of the classc:\codepy - decoall-meta-any py **__init__ **__init__ bob smith sue jones **giveraise **lastname **lastname smith jones metaclasses versus class decoratorsround (and lastas you might expectclass decorators intersect with metaclasses heretoo the following version replaces the preceding example' metaclass with class decorator that isit defines and uses class decorator that applies function decorator to all methods of class although the prior sentence may sound more like zen statement than technical descriptionthis all works quite naturally--python' decorators support arbitrary nesting and combinationsclass decorator factoryapply any decorator to all methods of class from types import functiontype from decotools import tracertimer metaclasses