Beispiel #1
0
// GetAttr returns the attribute of "obj" with the name "name".  This is
// equivalent to the Python "obj.name".
//
// Return value: New Reference.
func (obj *Base) GetAttr(name *Base) (*Base, error) {
	ret := C.PyObject_GetAttr(obj.c(), name.c())
	return obj2ObjErr(ret)
}
Beispiel #2
0
// PyObject* PyObject_GetAttr(PyObject *o, PyObject *attr_name)
// Return value: New reference.
// Retrieve an attribute named attr_name from object o. Returns the attribute value on success, or NULL on failure. This is the equivalent of the Python expression o.attr_name.
func (self *PyObject) GetAttr(attr_name *PyObject) *PyObject {
	return togo(C.PyObject_GetAttr(self.ptr, attr_name.ptr))
}
Beispiel #3
0
// GetAttr returns the attribute of "obj" with the name "name".  This is
// equivalent to the Python "obj.name".
//
// Return value: New Reference.
func (obj *BaseObject) GetAttr(name Object) (Object, error) {
	ret := C.PyObject_GetAttr(c(obj), c(name))
	return obj2ObjErr(ret)
}