Metaclass

Updated: 04/26/2017 by Computer Hope

In object-oriented computer programming, a metaclass is one whose instances are also classes. For instance, in Python, the built-in class type is a metaclass: instances of class type are themselves a class of objects.

The use of metaclasses is most prevalent in object-oriented languages. In these languages, classes are "first-class" objects, meaning they can be used exactly like any other object in the language.

It is possible, but uncommon, to implement metaclasses in C++ and Java. More commonly, metaclasses are found in programs written in Python, Ruby, Smalltalk, Perl, Objective-C, and Common Lisp/CLOS.

Object-oriented, Programming, Programming terms