I think the way @jdnc has done it is actually the correct way - see example 6 here:

http://www.onlamp.com/pub/a/python/2003/04/17/metaclasses.html

I can't claim to understand enough about why it should be this way, but I'll try and dig out some better references.