예제 #1
0
파일: object.go 프로젝트: MogeiWang/py
// 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)
}
예제 #2
0
파일: object.go 프로젝트: gward/go-python
// 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))
}
예제 #3
0
파일: base.go 프로젝트: xushiwei/gopy
// 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)
}