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