Python 中 type创建自定义类的一些理解
def say(self):print(“saying”)利用type来创建一个类 type( name, bases, dict)A = type(“C”, (object, ),{“sayagain”:say})print(type(A))a = A()print(type(a))print(a.dict)print(A.dict)a.sayagain()a.talkaga...
原创
2018-11-07 20:16:08 ·
2435 阅读 ·
0 评论