'type' 是 python built-in metaclass

其他继承自 ‘type’的class都可以是 Metaclass

子类可以继承父类的metaclass

然而 __metaclass__属性不能继承

__metaclass__可以定义成任何返回instance of 'type' callable

 

 

__new__(cls, ...)  : create instance of cls

__init__(self, ...) :instance already created and set properties to this instance

 

posted on 2016-10-01 22:10  学思罔殆  阅读(162)  评论(0编辑  收藏  举报