AI engineering glossary · Python advanced
What is metaclass?
Metaclass: A class whose instances are themselves classes, controlling how classes are created. The default is type. Metaclasses can register or modify classes automatically, though simpler tools are usually preferred. Most everyday problems are better solved with decorators or inheritance.
Metaclass: an example
class Meta(type) can check at class creation that every subclass defines a required method.
Related terms
More Python advanced terms
Where you learn it
Metaclass is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.