摘要: 反射: getattr,去对象中获取成员 v1 = getattr(对象,"成员名称") v2 = getattr(对象,"成员名称", 不存在时的默认值) setattr,去对象中设置成员 setattr(对象,"成员名称",值) hasattr,对象中是否包含成员 v1 = hasattr(对象 阅读全文
posted @ 2022-01-01 11:17 咖啡馆 阅读(14) 评论(0) 推荐(0) 编辑