py_set_attr function

Set an attribute of a Python object