You may be able to do this with a metaclass, but AFAIK is not a general solution for regular classes.
If these are just your own classes, you can adopt a coding standard that includes a specific class variable with your metadata, that is:
class Whatever(object): classAuthor = "me" classCreated = "now"
Or, if you use python that supports class decoders, you can use a decorator to automatically annotate it for you or to ensure that metadata is there.
But ... maybe you just want AClass.__name__ ?
source share