PyArg_ParseTuple SegFaults in CApi

后端 未结 1 1782
挽巷
挽巷 2021-01-22 01:49

I am writing a code, trying to get used to the C API of NumPy arrays.

#include 
#include \"numpy/arrayobject.h\"
#include 
#inclu         


        
相关标签:
1条回答
  • 2021-01-22 02:08

    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.

    0 讨论(0)
提交回复
热议问题