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

Robert Kern robert.kern@gmail....
Tue Apr 10 05:53:56 CDT 2012


On Tue, Apr 10, 2012 at 01:11, Travis Oliphant <teoliphant@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