MetaClasses

Metaclasses are actually introduced to solve a very specific problem. If every instance of a class is equal, how do you have some instance have different behavior? That is, the initialization tasks for each class will be different from one class to another. But every class is the same as all other classes, an instance of class Class.

Metaclasses permit us to add one layer of indirection, and thereby add some behavior between an object and the class Class. this is a powerful, but confusing, programming technique that we will not discuss any further here. Interested readers should take a look at some of the recent books that have been published on metaclass programming.

[audio] [real] Text to accompany slide8, in Chapter 20 of An Introduction to Object-Oriented Programming