> class List(list):
> def append(self, x):
> print x
> List.append(self, x) # What is the C equivalent of this call?
Always literally what you write in Python (assuming you meant
list.append):
PyObject_CallMethod(PyList_Type, "append", "OO", self, x);
HTH,
Martin
_
Raymond Hettinger wrote:
> class List(list):
> def append(self, x):
> print x
> List.append(self, x) # What is the C equivalent of this call?
Something like
PyObject *meth, *result;
meth = PyObject_GetAttrString(PyList_Type, "append")
result = PyObject_CallFunctionObj