would you rather count decorators or metaclasses amongst your weaponry(and please phrase your answer in terms of popular monty python skit test your knowledgeanswers metaclass is class used to create class normal new-style classes are instances of the type class by default metaclasses are usually subclasses of the type classwhich redefines class creation protocol methods in order to customize the class creation call issued at the end of class statementthey typically redefine the methods __new__ and __init__ to tap into the class creation protocol metaclasses can also be coded other ways--as simple functionsfor example--but they are always responsible for making and returning an object for the new class metaclasses may have methods and data to provide behavior for their classes too--and constitute secondary pathway for inheritance search--but their attributes are accessible only to their class instancesnot to their instance' instances in python xuse keyword argument in the class header lineclass (meta class=min python xuse class attribute instead__metaclass__ in xthe class header line can also name normal superclasses before the metaclass keyword argumentin you generally should derive from object toothough this is sometimes optional because both are automatically triggered at the end of class statementclass decorators and metaclasses can both be used to manage classes decorators rebind class name to callable' result and metaclasses route class creation through callablebut both hooks can be used for similar purposes to manage classesdecorators simply augment and return the original class objects metaclasses augment class after they create it decorators may have slight disadvantage in this role if new class must be definedbecause the original class has already been created because both are automatically triggered at the end of class statementwe can use both class decorators and metaclasses to manage class instancesby inserting wrapper (proxyobject to catch instance creation calls decorators may rebind the class name to callable run on instance creation that retains the original class object metaclasses can do the samebut may have slight disadvantage in this rolebecause they must also create the class object our chief weapon is decorators decorators and metaclasses metaclasses and decorators our two weapons are metaclasses and decorators and ruthless efficiency our three weapons are metaclassesdecoratorsand ruthless efficiency and an almost fanatical devotion to python our four no amongst our weapons amongst our weaponry are such elements as metaclassesdecorators 'll come in again metaclasses