2020
10-18
10-18
Python如何使用vars返回对象的属性列表
英文文档:vars([object])Returnthe__dict__attributeforamodule,class,instance,oranyotherobjectwitha__dict__attribute.Objectssuchasmodulesandinstanceshaveanupdateable__dict__attribute;however,otherobjectsmayhavewriterestrictionsontheir__dict__attributes(forexample,classesuseadictproxytopreventdirectdictionaryupdates).Withoutanargument,vars()actslik...
继续阅读 >