function decorators proved so useful that the model was extended to allow class decoration as of python and they were initially resisted because of role overlap with metaclassesin the endthoughthey were adopted because they provide simpler way to achieve many of the same goals class decorators are strongly related to function decoratorsin factthey use the same syntax and very similar coding patterns rather than wrapping individual functions or methodsthoughclass decorators are way to manage classesor wrap up instance construction calls with extra logic that manages or augments instances created from class in the latter rolethey may manage full object interfaces usage syntacticallyclass decorators appear just before class statementsin the same way that function decorators appear just before def statements in symbolic termsfor decora tor that must be one-argument callable that returns callablethe class decorator syntax@decorator class cdecorate class ( make an instance is equivalent to the following--the class is automatically passed to the decorator functionand the decorator' result is assigned back to the class nameclass cc decorator(crebind class name to decorator result ( essentially calls decorator( )( the net effect is that calling the class name later to create an instance winds up triggering the callable returned by the decoratorwhich may or may not call the original class itself implementation new class decorators are coded with many of the same techniques used for function decoratorsthough some may involve two levels of augmentation--to manage both instance construction callsas well as instance interface access because class decorator is also callable that returns callablemost combinations of functions and classes suffice however it' codedthe decorator' result is what runs when an instance is later created for exampleto simply manage class just after it is createdreturn the original class itselfthe basics