赞
踩
hasattr
hasattr() 函数是python的内置函数,用于判断对象是否包含对应的属性。
hasattr()
hasattr(object, name)
object
name
class add: x=2, y=3, s