摘要: 1、hasattr(object,attr) 判断一个对象里是否有某个属性或方法,返回布尔值,有为True,否则False class test(): name = "xiaoxiao" def say(self): return "HelloWord" t = test() has_name = 阅读全文
posted @ 2020-06-03 22:39 浅笑_0713 阅读(115) 评论(0) 推荐(0) 编辑