python object filed 转换成dict

差点像JAVA那样通过反射迭代属性,python根本不需要这样做,直接通过__dict__,参考overflow上面两篇dict to object,object to dict的文章:

 

http://stackoverflow.com/questions/61517/python-dictionary-from-an-objects-fields

http://stackoverflow.com/questions/1305532/convert-python-dict-to-object

你可能感兴趣的:(python)