Example #1
0
// 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)
}
Example #2
0
// 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)
}