摘要: # python dict 和 object 的相互转换 dict.py 借助 __dict__, isinstance 来实现对象与字典之间的相互转换 ``` def as_dict(obj): if not hasattr(obj, "__dict__"): return obj result 阅读全文
posted @ 2023-08-10 17:35 软匠 阅读(240) 评论(0) 推荐(0)