Skip to content Skip to sidebar Skip to footer

Pyarg_parsetuple Segfaults In Capi

I am writing a code, trying to get used to the C API of NumPy arrays. #include #include 'numpy/arrayobject.h' #include #include

Solution 1:

From the docs:

O (object) [PyObject *] Store a Python object (without any conversion) in a C object pointer. The C program thus receives the actual object that was passed. The object’s reference count is not increased. The pointer stored is not NULL.

O! (object) [typeobject, PyObject *] Store a Python object in a C object pointer. This is similar to O, but...

You're returning a stolen reference. Increment it first.

Post a Comment for "Pyarg_parsetuple Segfaults In Capi"