class' expected interfacedef extra(selfarg)def extras(class)if required()class extra extra return class class client client extras(client class client client extras(client class client client extras(client client ( extra(if you think this is starting to look reminiscent of class decoratorsyou're right in the prior we emphasized class decoratorsrole in augmenting instance creation calls because they work by automatically rebinding class name to the result of functionthoughthere' no reason that we can' use them to augment the class by changing it before any instances are ever created that isclass decorators can apply extra logic to classesnot just instancesat class creation timedef extra(selfarg)def extras(class)if required()class extra extra return class @extras class client client extras(client @extras class client rebinds class independent of instances @extras class client client ( extra(makes instance of augmented class is instance of original client decorators essentially automate the prior example' manual name rebinding here just as for metaclassesbecause this decorator returns the original classinstances are made from itnot from wrapper object in factinstance creation is not intercepted at all in this example metaclasses