Example #1
0
// int PyDict_DelItem(PyObject *p, PyObject *key)
// Remove the entry in dictionary p with key key. key must be hashable; if it isn’t, TypeError is raised. Return 0 on success or -1 on failure.
// int PyDict_DelItemString(PyObject *p, char *key)
// Remove the entry in dictionary p which has a key specified by the string key. Return 0 on success or -1 on failure.
func PyDict_DelItem(self, key *PyObject) error {
	err := C.PyDict_DelItem(topy(self), topy(key))
	return int2err(err)
}
Example #2
0
// DelItem removes the entry with the key of "key" from the dictionary d.  If
// "key" is not hashable, a TypeError is returned.
func (d *Dict) DelItem(key Object) error {
	ret := C.PyDict_DelItem(c(d), c(key))
	return int2Err(ret)
}
Example #3
0
File: dict.go Project: MogeiWang/py
// DelItem removes the entry with the key of "key" from the dictionary d.  If
// "key" is not hashable, a TypeError is returned.
func (d *Dict) DelItem(key *Base) error {
	ret := C.PyDict_DelItem(d.c(), key.c())
	return int2Err(ret)
}