classSettingMeta(object):def__new__(cls,*args,**kwargs):importpdb;pdb.set_trace()print"new"returnsuper(SettingMeta1,cls).__new__(cls,*args,**kwargs)def__init__(self,*args):print"init"Setting=SettingMeta('Setting',(object,),{})classBind(Setting):action="append"defadd1(self):print"123"此时Setting是SettingMeta的实例,为什么加载Bind的时候会调用SettingMeta.new?不太理解。。。
撒科打诨
相关分类