Check if a Python object has an attribute
py_has_attr(x, name)
x
Python object
name
Attribute name
Logical indicating whether it has the specified attribute