[Numpy-discussion] Getting C-function pointers from Python to C

Robert Kern robert.kern at gmail.com
Tue Apr 10 06:53:56 EDT 2012


On Tue, Apr 10, 2012 at 01:11, Travis Oliphant <teoliphant at gmail.com> wrote:

>        1) Create an API for such Ctypes function pointers in NumPy and use the ctypes object structure.  If ctypes were to ever change it's object structure we would have to adapt this API.
>
>        Something like this is what is envisioned here:
>
>             typedef struct {
>                        PyObject_HEAD
>                        char *b_ptr;
>             } _cfuncptr_object;

Why not just use PyCapsules?

http://docs.python.org/release/2.7/c-api/capsule.html

-- 
Robert Kern



More information about the NumPy-Discussion mailing list