hasattr(object, name)

查看object有没name属性

有返回True 没有返回 False

猜你喜欢

转载自www.cnblogs.com/whigym/p/9920504.html
今日推荐