示例#1
0
文件: object.go 项目: MogeiWang/py
// GetItem returns the element of "obj" corresponding to "key".  This is
// equivalent to the Python "obj[key]".
//
// Return value: New Reference.
func (obj *Base) GetItem(key *Base) (*Base, error) {
	ret := C.PyObject_GetItem(obj.c(), key.c())
	return obj2ObjErr(ret)
}
示例#2
0
文件: base.go 项目: xushiwei/gopy
// GetItem returns the element of "obj" corresponding to "key".  This is
// equivalent to the Python "obj[key]".
//
// Return value: New Reference.
func (obj *BaseObject) GetItem(key Object) (Object, error) {
	ret := C.PyObject_GetItem(c(obj), c(key))
	return obj2ObjErr(ret)
}