bool PMapping::DelItem(char* key) { if (!this->myObject) { throw new NULLPyObjectException(); } if (PyMapping_DelItemString(this->myObject, key) == -1) { return false; } return true; }
static void set_float(int num, char const *name, PyObject *dict) { PyObject *value = PyMapping_GetItemString(dict, name); if (!value) return; PyMapping_DelItemString(dict, name); shmem->floats[num] = PyFloat_AsDouble(value); Py_DECREF(value); }
static PyObject *get_object(char const *name, PyObject *dict) { FUNCTION_START; PyObject *value = PyMapping_GetItemString(dict, name); if (!value) { debug("Requested object %s not found", name); return NULL; } PyMapping_DelItemString(dict, name); return value; }
static void set_int(int num, char const *name, PyObject *dict) { PyObject *value = PyMapping_GetItemString(dict, name); if (!value) { debug("not setting value for %s, which is not in the dict", name); return; } PyMapping_DelItemString(dict, name); shmem->ints[num] = PyLong_AsLong(value); Py_DECREF(value); }