> Raising an Exception would be the usual way. > yeah, but depending on your design and what you want to check for, you might not get a chance to raise an exception. for example, if i provide a base class and want to do some checking when someone subclasses it, i can't really do that. i only get a chance to test once an instance of that subclass is created, in the __init__ or __new__ method, and only if the user correctly dealt with calling super classes. a metaclass lets you check and modify a number of things at the moment that the class is declared. you could, for example, test that a method has been overridden or that the name of the class matches some convention, even before the class is instantiated.
-chad -- http://groups.google.com/group/python_inside_maya
