A metaclass is a class whose instances are in turn classes. In object-oriented programming languages with metaclasses, classes are viewed as objects, called class objects. These class objects are then in turn instances of a class, which is called a metaclass. Since metaclasses can also be regarded as class objects, metaclasses and class objects cannot be clearly distinguished from each other. The concept of metaclasses allows you to manipulate class definitions dynamically.
Informationen zum Artikel