#元类
type(类名,(父类名.....),{"键","值}
第一种方式
def xxxx(类名,父类名...,属性):
return type(类名,父类名...,属性)
第二种方式
class Xxx(type):这个必须继承type
def __new__(cls,类名,父类名....,属性):
return type.__new__(cls,类名,父类名...,属性)
#用法
class A(object,metaclass=上面的引用)
pass
type(类名,(父类名.....),{"键","值}
第一种方式
def xxxx(类名,父类名...,属性):
return type(类名,父类名...,属性)
第二种方式
class Xxx(type):这个必须继承type
def __new__(cls,类名,父类名....,属性):
return type.__new__(cls,类名,父类名...,属性)
#用法
class A(object,metaclass=上面的引用)
pass