class M(type): def __str__(self): return "gege" aa = "ccf" cc = "ccc" class TM: cc = "ddd" __metaclass__ = M print (TM.__class__)#<class '__main__.M'> a = TM() print (TM.__metaclass__.cc)#ccc print (TM.aa)#ccf…
帮助https://docs.python.org/2/library/functions.html dir() 函数 D:\pythontest>python Python (v3. , ::) [MSC v. bit (AM D64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>>…