parameterized metaclass (or metametaclass)

michele.simionato at michele.simionato at
Thu Jan 6 10:15:20 EST 2005

> I was wondering if there is some simpler way of building
> metaclasses ?

Why not just a function returning metaclasses?

def metaFactory(*args):
dic = <something possibly depending on args>
return type("somemetaclass", (type,), dic)

Alternatively, a metaclass classmethod returning a metaclass, so that
you can use something like

__metaclass__ = MyMetaclass.with(*args) # classmethod returning a

         Michele Simionato

More information about the Python-list mailing list