--although metaclass can take the form of simple callable that invokes type to create the class directly and passes it on to the decorator in other wordsthe crucial hook in the model is the type call issued for class construction given thatmetaclasses and class decorators are often functionally equivalentwith varying dispatch protocol modelsdef metaclass(clsnamesupersattrdict)return decorator(type(clsnamesupersattrdict)def decorator(cls)class (ametaclass=metaclass)metas can call decos and vice versa in factmetaclasses need not necessarily return type instance either--any object compatible with the class coder' expectations will do--and this further blurs the decorator/metaclass distinctiondef func(namesupersattrs)return 'spamclass (metaclass=func)attr 'huh? class whose metaclass makes it stringcc upper(('spam''spam'def func(cls)return 'spam@func class cattr 'huh? class whose decorator makes it stringcc upper(('spam''spam'odd metaclass and decorator tricks like these asidetiming often determines roles in practiceas stated earlierbecause decorators run after class is createdthey incur an extra runtime step in class creation roles because metaclasses must create classesthey incur an extra coding step in instance management roles in other wordsneither completely subsumes the other strictly speakingmetaclasses might be functional supersetas they can call decorators during class creationbut metaclasses can also be substantially heavier to understand and codeand many roles intersect completely in practicethe need to take over class creation entirely is probably much less important than tapping into the process in general exampleadding methods to classes