Digression Start
I just learnt what metaclasses are in Python. I don't think that the creators of python wanted everyone to use them. I mean name something a metaclass which might not be a class in most cases is enough to divert most people away from this concept!
Digression end
On to my question. I wrote this simple metaclass to add a default doc string to all classes that are created in the module. But it is not working:
def metest(cls,name,bases,dict):
cls.setattr(cls,'__doc__',"""Default Doc""")
return type(cls,(),{})
__metaclass__=metest
class test(object):
pass
print test.__doc__
t=test()
print t.__doc__
Output:
None
None
What am I doing wrong?