Chris Colbert wrote:
changing the include definition to:

cdef extern from "Python.h":
     int PyObject_GenericSetAttr(PyObject*, PyObject*, PyObject*) except -1

This suggests another possible workaround:

  cdef extern from "Python.h":
int PyObject_GenericDelAttr "PyObject_GenericSetAttr" (object, object, PyObject*)

This creates an alias for PyObject_GenericSetAttr with a different
signature, which you then call as

  PyObject_GenericDelAttr(obj, name, NULL)

If you're willing to write a tiny bit of C, you could make this tidier
by using a .h file containing

#define PyObject_GenericDelAttr(obj, name) PyObject_GenericSetAttr(obj, name, 
NULL)

and then declare PyObject_GenericDelAttr to Cython with just two
arguments.

Maybe Cython should include something like this in its standard preamble,
along with similar macros for other NULL-taking API functions.

--
Greg
_______________________________________________
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel

Reply via email to