metaclasses and decorators is somewhat arbitrary decorators can be used to manage both instances and classesand intersect most strongly with metaclasses in the second of these rolesbut this discrimination is not absolute in factthe roles of each are determined in part by their mechanics as we'll see aheaddecorators technically correspond to metaclass __init__ methodsused to initialize newly created classes metaclasses have additional customization hooks beyond class initializationthoughand may perform arbitrary class construction tasks that might be more difficult with decorators this can make them more complexbut also better suited for augmenting classes as they are being formed for examplemetaclasses also have __new__ method used to create classwhich has no analogy in decoratorsmaking new class in decorator would incur an extra step moreovermetaclasses may also provide behavior acquired by classes in the form of methodswhich have no direct counterpart in decorators eitherdecorators must provide class behavior is less direct ways converselybecause metaclasses are designed to manage classesapplying them to managing instances alone is less optimal because they are also responsible for making the class itselfmetaclasses incur this as an extra step in instance management roles we'll explore these differences in code later in this and will flesh out this section' partial code into real working example later in this to understand how metaclasses do their workthoughwe first need to get clearer picture of their underlying model there' magicand then there' magic this "increasing levels of magiclist deals with types of magic beyond those widely seen as beneficial by programmers some might add python' functional tools like closures and generatorsand even its basic oop supportto this list--the former relying on scope retention and automatic generator object creationand the latter on inheritance attribute search and special first function argument though based on magic toothese represent paradigms that ease the task of programming by providing abstractions above and beyond the underlying hardware architecture for exampleoop--python' earlier paradigm--is broadly accepted in the software world it provides model for writing programs that is more completeexplicitand richly structured than functional tools that issome levels of magic are considered more warranted than othersafter allif it were not for some magicprograms would still consist of machine code (or physical switchesit' usually the accumulation of new magic that puts systems at risk of breaching complexity threshold--such as adding functional paradigm to what was always an oo languageor adding redundant or advanced ways to achieve goals that are rarely pursued in the common practice of most users such magic can set the entry bar far too high for large part of your tool' audience to metaclass or not to metaclass