All pastes #925955 Raw Edit

Some metaclass questions

public python v1 · immutable
·published 2008-03-03 13:11 UTC
rendered paste body
# Is this the simplest way to create a bunch of classes that automagically # announce their definition?class MetaFoo(type):    def __init__(cls, name, bases, dct):        print cls.__name__ + ' defined!'class Foo(object):    __metaclass__ = MetaFoo    # Is there any way I can get a reference to Foo here (i.e. while its being     # defined?)