15 static inline void notEnoughMemory(
void) {
16 std::cerr <<
"[ERROR] Not enough memory for allocation" << std::endl;
22 PyObject* dict = PyDict_New();
30 PyObject* list = PyList_New(len);
38 PyObject* tuple = PyTuple_New(len);
46 PyObject* s = PyStr_FromString(v);
54 PyObject* c =
nullptr;
59 c = PyObject_CallFunctionObjArgs((PyObject*)&PyType_Type, n, b, d, NULL);
73 int r = PyDict_SetItemString(p, key, val);
80 int r = PyDict_SetItem(p, key, val);
PyObject * xPyClass_New(PyObject *b, PyObject *d, PyObject *n)
Creates a PyClass and raises an exception if it fails. dict is copied in Py3 ! All references are dec...
PyObject * xPyTuple_New(Py_ssize_t len)
Creates a PyTuple and raises an exception if it fails.
PyObject * xPyString_FromString(const char *v)
Creates a PyString and raises an exception if it fails.
PyObject * xPyList_New(Py_ssize_t len)
Creates a PyList and raises an exception if it fails.
int xPyDict_SetItem(PyObject *p, PyObject *key, PyObject *val)
Same as PyDict_SetItem but decrements reference on object and key.
PyObject * xPyDict_New(void)
Creates a PyDict and raises an exception if it fails.
int xPyDict_SetItemString(PyObject *p, const char *key, PyObject *val)
Same as PyDict_SetItemString but decrements reference on object.